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

Bflag = False
Rflag = False
count = 0
for i in range(N):
    if S[i] == '#':
        Bflag = True
        Rflag = True
    elif Bflag is True:
        if Rflag is True:
            count = count + 1
        Rflag = False
            

print(count)