N = int(input())
S = list(input())
if S == ['*'] * N or S == ['.'] * N:
    print(0)
    exit()

for i in range(N - 1, -1, -1):  # #->.
    if S[i] == '.':
        num1 = i
        break

for j in range(N):  # .->#
    if S[j] == '#':
        num2 = j
        break

ans1 = S[:num1].count('#')
ans2 = S[num2 + 1:].count('.')
print(min(ans1, ans2))
