l = gets.chomp
while l != '#' do
    right = ['y','u','i','o','p','h','j','k','l','n','m']
    count = 0
    rightFlug = right.include?(l[0])
    
    l.length.times do |i|
        if right.include?(l[i]) != rightFlug
            count += 1
            rightFlug = right.include?(l[i])
        end
    end
    
    p count
    l = gets.chomp
end

