N = int(input())
S = input()
ans1 = 0
flag = False
for i in range(N):
    if S[i] == '#':
        flag = True
    elif flag and S[i] == '.':
        ans1 += 1
    else:
        pass

ans2 = 0
for i in reversed(range(N)):
    if S[i] == '.':
        flag = True
    elif flag and S[i] == '#':
        ans2 += 1
    else:
        pass

print(min(ans1,ans2))
