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

stack = []


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

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

print(ans)
