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
        if num1 == 0:
            print(0)
            exit()
        break

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

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