import numpy as np
N = int(input())
S = list(input())

white_count=0
black_count=0
white_acc_list=[]
black_acc_list=[]
for i in range(N):
    if(S[i]=="."):
        white_count+=1
    else:
        black_count+=1
    black_acc_list.append(black_count)
    white_acc_list.append(white_count)

v = []
for i in range(N):
    v.append(black_acc_list[i]+(white_acc_list[N-1]-white_acc_list[i]))

#print(v)
print(np.min(v))
