n = int(input())
s = list(input())

counter = 0
for i in range(n-1):
    if s[i] == "#":
        for j in range(n-1-i):
            if s[j+i+1] == ".":
                counter += 1
            else:
                pass
    break

print(counter)
