from collections import Counter
N = int(input())
S = input()
pt = S.find("#")
ct = 0
bl_ls = []
wh_ls = []
last_wh = 0
last_bl = 0
if pt == -1:
    print(0)
else:
    for i in range(N):
        if S[i] == ".":
            last_wh += 1
            wh_ls.append(last_wh)
            bl_ls.append(last_bl)
        else:
            last_bl += 1
            wh_ls.append(last_wh)
            bl_ls.append(last_bl)
    _min = 1e9
    for i in range(N):
        res = wh_ls[N-1] - wh_ls[max(0,i-1)] + bl_ls[max(0,i-1)]
        _min = res if res < _min else _min
    print(_min)