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

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

    b_num = S[1:].count('#')
    w_num = 0 if S[0] == '#' else 1
    ans = 10e6

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

    print(ans)
