if __name__ == '__main__':
    N = int(input())
    S = input()

    if '#' not in S or '.' not in S:
        print(0)
        exit()

    b_num = 0
    w_num = S.count('.')
    ans = 10e6

    for i in range(N):
        ans = min(ans, b_num + w_num)
        if S[i] == '#':
            w_num += 1
        else:
            b_num -= 1

    print(ans)
