N = int(input())
S = list(input())
sr = S[::-1]
ans = sr[0]
cnt = 0
if S.count('#')>S.count('.'):
  word = '#'
else:
  word = '.'

for i in range(N):
  if ans[-1]=='.' and sr[i]=='#':
    cnt+=1
    ans+=word
  else:
    ans+=sr[i]
print(cnt)
