import sys

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

flag = 0
count = 0

for i in range(N):
    if flag == 1:
        if S[i] == ".":
            count += 1
    else:
        if S[i] == "#":
            flag = 1
            
print(count)