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

cum_sum_b = [0]
cum_sum_w = [0]

sum_b = 0
sum_w = 0
for i, s in enumerate(S):
    if s == '#':
        sum_b += 1
    else:
        sum_w += 1
    cum_sum_b.append(sum_b)
    cum_sum_w.append(sum_w)

ans = N
for i in range(1, len(S)):
    count = cum_sum_b[i] + cum_sum_w[len(S)] - cum_sum_w[i]
    ans = min(ans, count)

print(ans)