n = int(input())
k,d = 0,0
s = list(input())

if s[0] == '.':
  for i in range(1,n):
    if s[i] == '#':
      k+=1
    else:
      d+=1
else:
  for i in range(n):
    if s[i] == '#':
      k+=1
    else:
      d+=1
      
print(min(k,d))