N = int(input())
S = input()
tmp = S.count('.')
if S[0] == '.':
    counter = 0
    count = 0
    while count < len(S) and S[count] != '#':
        counter += 1
        count += 1
    tmp -= counter 
print(tmp)
