N = int(input())
S = input()
ans = 0
fKK = N
for i in range(N):
    if S[i:i+2] == '##':
        fKK = i
for j in range(i):
    if S[j:j+2] == '#.':
        ans += 1
for K in range(i,N):
    if S[K] == '.':
        ans += 1
print(ans)
