def c_stones(N, S):
    import itertools
    if S.count('#') == 0 or S.count('.') == 0:
        return 0
    s = [(k, len(list(v))) for k, v in itertools.groupby(S)]
    ans = float('inf')
    for i in range(len(s)):
        ans1, ans2 = 0, 0
        if s[i][0] == '#':
            # ここから黒にする
            for j in range(len(s)):
                if j < i and s[j][0] == '#':
                    ans1 += s[j][1]
                elif j > i and s[j][0] == '.':
                    ans1 += s[j][1]
        elif s[i][0] == '.':
            # ここまで白にする
            for j in range(len(s)):
                if j < i and s[j][0] == '#':
                    ans1 += s[j][1]
                elif j > i and s[j][0] == '.':
                    ans1 += s[j][1]
        ans = min(ans1, ans)
    return ans

N = int(input())
S = input()
print(c_stones(N, S))
