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