# coding: utf-8

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

nmin = S.find('#.')

num_white = S.count('.')
num_black = S.count('#')

num_white_right = S[nmin+1:].count('.')
num_black = S[nmin+1:].count('#')

all_black = num_white
all_white = num_black
split = S[:nmin+1].count('#') + S[nmin+1:].count('.')

otvet = min(all_black, all_white, split)
print(otvet)
