# -*- coding: utf-8 -*-

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

num_white = 0
num_black = 0
ansb = 0
answ = 0
for i in range(N):
    if S[i] == '.':
        ansb = num_black
        num_white += 1
    else:
        answ = num_white
        num_black += 1

print(min([num_white - answ, ansb, num_white]))