n = input()
s = input()
sp = s.find('#')
if sp != -1:
  s = s[sp:]
ep = s.rfind('.')
if ep != -1:
  s = s[:ep+1]
b = s.count('#')
w = s.count('.')

lpb = s.rfind('#')
ew = len(s) - (lpb+1)
s = s[:lpb]
s = s[:s.rfind('.')+1]
bn = s.count('#')

ans = min([b,w,bn+ew])
print(ans)

