import bisect
N = int(input())
S = input()
ans = S.count('.')
num = 0
for x in S:
    if x == '#':
        break
    else:
        num += 1
c = S.count('#')
d = 0
for x in S[::-1]:
    if x == '.':
        break
    else:
        d += 1
print(min(ans-num, c-d))