    N = int(input())
    S = input()
    fb = 0
    cand = []
    b = []
    w = []
    cand.append(S.count('#'))
    cand.append(S.count('.'))
    for i in range(N):
        if S[i] == '#':
            b.append(i)
        elif S[i] == '.':
            w.append(i)
    for i in range(len(b) - 1):
        wh = 0
        for j in w:
            if j > b[i + 1]:
                wh += 1
        cand.append(1 + i + wh)
    print(min(cand))
main()
