
import numpy as np

N = int(input())
s = input()

S = []
for c in s:
    S.append(c)
    
A = np.zeros(N+1)
if S[0] == "#":
    A[0] = 0 
for i in range(1,N+1):
    if S[i-1] == "#":
        A[i] = A[i-1] + 1
    else:
        A[i] = A[i-1]
    

minimum = N
for i in range(N+1):
    num = int(A[i] + (N-i-(A[N]-A[i])))
    if minimum > num:
        minimum = num
print(num)
    

    



