gets
s = gets.strip

dp_sharp = s.chars.inject([]){|a, c| a + [(a[-1] || 0) + (c == "#" ? 1 : 0)] }
dp_dot = s.reverse.chars.inject([]){|a, c| a + [(a[-1] || 0) + (c == "." ? 1 : 0)] }.reverse

puts dp_sharp.zip(dp_dot).map{|a, b| a + b - 1}.min
