def main():
    N = int(input())
    S = input()
    cand = []
    b = []
    cand.append(S.count('#'))
    cand.append(S.count('.'))
    for i in range(N):
        if S[i] == '#':
            b.append(i)
    S = int(S.replace('#', '1').replace('.', '0'), 2)
    for i in range(len(b)-1):
        cand.append(str(S^int('1'*(N - 1 - b[i+1] + 1),2)).count('1'))
    print(min(cand))
main()
