Counting numbers using vertical lines