import re

n = int(input())
s = input()
left = 0
right = len(re.findall('\.', s))

result = n
for i in range(n):
    if s[i] == '#':
        left += 1
    else:
        right -= 1
    tmp = left + right
    if tmp < result:
        result = tmp

print(result)







