n = int(input())
s = str(input())

out = 0

check = False

for i in range(len(s)):
    if s[i] == '#':
        check = True
    if s[i] == '.':
        if check == True:
            out += 1

print(out)