n = int(input())
s = list(input())
b = [0]*(n)
w = [0]*(n)
if s[0] ==".":
    w[0] =1
else:
    b[0] =1
for i in range(1,n):
    if s[i] == ".":
        w[i] = w[i-1] + 1
        b[i] =b[i-1]
    else:
        b[i] = b[i-1] + 1
        w[i] = w[i-1]
ans = n

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