n = int(input())
s = input()

cnt = 0
items = list(s)
num1 = items.count('#')
num2 = items.count('.')

ans1 = min(num1, num2)

ind = s.find('.')
sub1 = s[:ind]
sr = ''.join(reversed(list(s)))
ind = sr.find('#')
sub2 = sr[:ind]

num1 = sub1.count('#')
num2 = sub2.count('.')
ans2 = min(num1, num2)


print(min(ans1, ans2))

