n = int(input())
s = list(input())
count_b_l = 0
count_w_r = 0
for i in range(len(s)):
    if s[i] == '.':
        count_w_r += 1
result = []
for i in range(len(s)):
    if s[i] == '#':
        count_w_r += 1
    else:
        count_b_l -= 1
    result.append(count_b_l+count_w_r)
print(min(result))