from collections import Counter
 
n = int(input())  
s = input()  
cnt = Counter(s)
cb = cnt['#']
cw = cnt['.']
cbw = 0
for i in range(n):
  if s[i] == '.':
    cw -= 1
  else:
    break
    
for i in range(n-1, -1, -1):
  if s[i] == '#':
    cb -= 1
  else:
    break
    
for i in range(n):
  if s[i] == '#':
    cbw += 1
  else:
    break
    
for i in range(n-1, -1, -1):
  if s[i] == '.':
    cbw += 1
  else:
    break

if cbw == 0:
  print(min(cw,cb))
else:
  print(min(cw, cb, cbw))