# -*- coding utf-8 -*-
N = int(input())
S = input()

ans = 0
frag = False
for s in S:
    if s == '#':
        frag = True
    if frag and s == '.':
        ans += 1
ans = min(ans, S.count('#'))
print(ans)

