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

first_black = -1
for i in range(n):
    if s[i] == '#':
        first_black = i
        break

result = 0
if first_black > -1:
    for i in range(first_black, n):
        if s[i] == '.':
            result += 1

print(result)