N = int(input())
S = input()
t_min = min(S.count("#"), S.count("."))
S_first = [S[0]]
S_second = list(S[1:])
for i in range(1,N):
    S_first.append(S[i])
    del S_second[0]
    t = 0
    t += S_first.count("#")
    t += S_second.count(".")
    t_min = min(t_min, t)
print(t_min)