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

def add_one(x):
    return x + 1

w_counter_before = [0] * n
w_counter_all = 0
for i in range(n):
    if s[i] == '.': # white
        w_counter_before[i:] = list(map(add_one, w_counter_before[i:]))
        w_counter_all += 1

if w_counter_all == 0:
    print(0)
else:
    counters = []
    for i in range(n):
        cost1 = i - w_counter_before[i] + 1
        cost2 = w_counter_all - w_counter_before[i]
        counters.append(cost1 + cost2)
    print(min(counters))
