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

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

    if right_cost == 0:
        return(0)

    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

    return(min_cost)

print(calc())
