N = int(input())
S = input()
c1 = [0] * N
c2 = [0] * N
ans = N
for i in range(N):
    c1[i] += c1[i - 1] + 1 * (S[i] == "#")
    c2[i] += c2[i - 1] + 1 * (S[i] == ".")
c1 = [0] + c1
c2 = [0] + c2
#print(c1)
#print(c2)
for i in range(N):
    #print(c1[i], c2[N] - c2[i])
    ans = min(ans, c1[i] + c2[N] - c2[i])
print(ans)