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

list_b = []
cnt_b = 0
list_w = []
cnt_w = 0
for i in range(n):
    if s[i] == "#":
        cnt_b += 1
    else:
        cnt_w += 1
    list_b.append(cnt_b)
    list_w.append(cnt_w)
print(list_b)
print(list_w)
ans = 2*10**5
for i in range(n):
    if ans > list_b[i] + list_w[n-1] - list_w[i]:
        ans = list_b[i] + list_w[n-1] - list_w[i]
print(min(ans,list_b[n-1],list_w[n-1]))