N = int(input())
S = [1 if x == '.'  else 0 for x in list(input())]

min_cost = 2*10**5
for i in range(1, N, 1):
    head = S[:i]
    tail = S[i:]
    cost = (i - sum(head)) + sum(tail)

    if min_cost > cost:
        min_cost = cost
        
print(min_cost)