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

min_cost = n

for i in range(n+1):
    s_left = s[:i]
    s_right = s[i:]
    cost = s_left.count('#') + s_right.count('.')
    if cost < min_cost:
        min_cost = cost

print(min_cost)
