N = int(input())
S = input()
flag = False
res = 0
for i in range(N):
    if S[i] == '#':
        flag = True
    if S[i] == '.' and flag == True:
        res += 1
        flag = False
        
print(res)