n = int(input())
input_str = input()
left_black = 0
right_white = input_str.count('.')
ans = []
for s in input_str:
  if( s == '#' ):
    left_black += 1
  if( s == '.' ):
    right_white -= 1
  ans.append(left_black + right_white)
print(min(ans))