n = int(input())
s = input()

b = [0]  # 黒の累積和
w = [0]  # 白の累積和

count_b = 0
count_w = 0
for i in range(n):
    if s[i] == "#":
        # 黒なら
        count_b += 1
    else:
        # 白なら
        count_w += 1
    b.append(count_b)
    w.append(count_w)

ans = n
for i in range(n+1):
    ans = min(ans, b[i]+w[n-1]-w[i])
print(ans)
