N = int(input())
S = input()

tmp = True
l = 0

ct = S.count('.')
for i in range(N):
    if S[i] == '.' and tmp:
        l += 1
    if S[i] == '#' and tmp:
        tmp = False
print(min(ct - l, N - ct))