s=gets.chomp if s.size==1 then puts 0 else i=0 p=0 ans=0 while p