n = int(input())
s = list(str(input()))
B = [0]*(n+1)
W = [0]*(n+1)

for i in range(n):
    B[i+1] = B[i]
    if s[i] == '#':
        B[i+1] += 1

s.reverse()
for i in range(n):
    W[i+1] = W[i]
    if s[i] == '.':
        W[i+1] += 1

B += [B[-1]]
W += [W[-1]]

ans = 10**18
for i in range(-1, n+1):
    ans = min(B[i+1]+W[n-i], ans)
print(ans)
