# -*- coding: utf-8 -*-

# input
# 3
# #.#

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

w = S.count(".")
b = S.count("#")

if w == N or b == N:
    print(0)
    exit()


ans = len(S)
for i in range(len(S)):
    w_n = S[i:].count(".")
    b_n = S[:i].count("#")

    ans = min(ans, w_n + b_n)

print(ans)