N = int(input())
S = input()
a = S[S.find('#'):].count('#')
b = S[S.find('#'):].count('.')
c = S[::-1][S[::-1].find('.'):].count('#')
d = S[::-1][S[::-1].find('.'):].count('.')
e = S[:S.find('.')].count('#') + S[::-1][:S[::-1].find('#')].count('.')
print(min(a, b, c, d, e))