N = int(input())
S = input()
cnt = 0
for i in range(0,N-1):
    if(S[i] == '#'):
        i += 1
        while (i < N and S[i] == '.'):
            cnt += 1
            i += 1
            #print(i)
print(cnt)