# coding: utf-8
# Your code here!

N = int(input())
S = [x for x in input()]

cum_white = []
count = 0
for i, s in enumerate(S):
    if s == '.':
        count += 1
    cum_white.append(count)
    
if len(cum_white) == 0 or len(cum_white) == N:
    print(0)
else:
    min_num = int(1e10)
    for i, n_white in enumerate(cum_white):
        num = (i - n_white) + (N - cum_white[-1] - n_white)
        min_num = min(min_num, num)
        
    print(min_num)