# -*- coding:utf-8 -*-

def solve():
    N = int(input())
    S = input()

    # 全部 ############# にするパターン
    ans1 = 0
    for i in range(0, len(S)):
        if S[i] == ".":
            ans1 += 1
    
    # 全部 .............. にするパターン
    ans2 = 0
    for i in range(0, len(S)):
        if S[i] == "#":
            ans2 += 1

    # ...........########### にするパターン
    stones = []
    stones_num = []
    stone = S[0]
    num = 1
    for i in range(1, len(S)):
        if stone == S[i]:
            num += 1
            continue
        else:
            stones.append(stone)
            stones_num.append(num)
            stone = S[i]
            num = 1
    stones.append(stone)
    stones_num.append(num)
    
    ans3 = 2*(10**5)+1
    for i in range(len(stones_num)):
        ans = 0
        if stones[i] == ".":
            ans += stones_num[i]
            for j in range(i+2, len(stones_num), 2):
                ans += stones_num[j]
            for j in range(i-3, -1, -2):
                ans += stones_num[j]
        else:
            ans += stones_num[i]
            for j in range(i+3, len(stones_num), 2):
                ans += stones_num[j]
            for j in range(i-2, -1, -2):
                ans += stones_num[j]

        ans3 = min(ans3, ans)
    
    print(min(ans1, ans2, ans3))





        

        




    
    

    





if __name__ == "__main__":
    solve()