N=int(input())
S = input()
left = -1
for i, s in enumerate(S):
    if s == '#':
        left = i
        break
if S[-1] == '#':
    t=len(S.split('.')[-1])
    print(min(S.count('#')-t, S[left:].count('.')))
else:
    print(min(S.count('#'), S[left:].count('.')))
