N = int(input())
S = list(input())

count_list =[]
wc = 0

for n in range(N):
    if(S[n] == '.'):
        num = n
        count_list.append(len([ i for i in S[num+1:] if i == '#']) + wc)
        wc += 1

if(S[N-1] == '.'):
    count_list[-1] = count_list[-1] + 1

count = min(count_list)
print(count)