l=gets.chomp.chars c1 = l.count{|c| "as".chars.include?(c)} c2 = l.count{|c| "lo".chars.include?(c)} p (2**c1-1) * (2**c2-1)