n = int(input())
s = input()

black_right, min_val = 0, 2000001
white_left = s.count('.')

for moji in range(s):
    if moji == '.':
        white_left -=1
    else:
        black_right += 1
    min_val = min(min_val, white_left+black_right)

print(min_val)