Subject: rewrite count in python by myself
Description：
Subject: fix count to adjust more general case
Description：