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

sp_pos = S.find('#')
dot_num = S[sp_pos+1:].count('.')

dot_pos = S.rfind('.')
sp_num = S[:dot_pos].count('#')

hl = len(S) // 2
hl_num = S[:hl].count('#') + S[hl:].count('.') 

print(min(dot_num, sp_num, hl_num))