n = int(input())
s = input()
black_appered = False
ans = 10**9
count =s.count('.')
# [BBB...WWW...]の組を抽出する
for x in s:
    if x =='.':
        count -= 1
    else:
        count += 1
    ans = min(ans,count)
    # print(ans)
    # print("===")
print(ans)