from sys import exit

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

stack = []


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

if N // 2 >= len(stack):
    ans = len(stack)
else:
    ans = N - len(stack)

if not stack:
    print(ans)
    exit()

if j - (len(stack) - 1) < ans:
    ans = stack[len(stack) - 1] - len(stack) - 1

print(ans)
