expect_num = '1000000007'.count('0') puts (expect_num - gets.count('0')).abs