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

all_Black = S.count('.')
all_White = S.count('#')
White_Black = all_Black + all_White

l_sum = []

for i in range(len(S)):
    #print(S[0:i].count('#'),S[i:len(S)].count('#'))
    l_sum.extend([S[0:i].count('#')+S[i:len(S)].count('#')])

print(min(all_Black,all_White,White_Black))
