from sys import exit

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

stack = []


for i in range(N):
    if S[i] == '.':
        stack.append(i)
        j = i

if stack:
    ans = min(j - (len(stack) - 1), len(stack))
else:
    ans = 0

print(ans)
