Counter and its application