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

suu = []
s_count = S.count('.')
k_count = 0
for i in range(N):
    if S[i] == "#":
        k_count += 1
    else:
        s_count -= 1
    suu.append(k_count + s_count)

print(min(suu))
