N = int(input())
S = input()
cnt = 0
i = 0
while i < N:
    if(S[i] == '#'):
        i += 1
        while (i < N and S[i] == '.'):
            cnt += 1
            i += 1
            #print(i)
    else:
        i += 1
print(cnt)