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

if s[0] == '#':
    left = 1
else:
    left = 0

right = s[1:].count('.')

p_min = left + right

for i in range(1, n):
    if s[i] == '.':
        right -= 1
    else:
        left += 1
    
    p_min = min(p_min, (left + right))

print(p_min)