def main():
    N = int(input())
    S = input()

    black_cnt = S.count('#')
    white_cnt = S.count('.')

    if black_cnt == 0 or white_cnt == 0:
        print(0)
    else:
        print(min(black_cnt, white_cnt))


if __name__ == '__main__':
    main()