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

cost = sum(S)
min_cost = cost 

for i in range(1, N, 1):
    if S[i-1] == 0:
        cost += 1
    else:
        cost -= 1

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