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

min_cost = n
left_cost = 0
right_cost = s.count('.')

for i in range(n):
    if s[i] == '#':
        left_cost += 1
    else:
        right_cost -= 1
    cost = left_cost + right_cost
    if cost < min_cost:
        min_cost = cost

print(min_cost)
