n = int(input())
s = list(input())

ans = 0
k = 0
for i in range(n):
    if s[i] == '#':
        k+=1
        if i != n-1 and s[i+1] == '.':
            ans +=1

if k == n:
    print(0)
else :
    print(ans)
    