Is "what a pity" used as often as "what a shame"?

For the most part, they are the same, but there are some slight differences.

What a pity expresses sorrow. It is harsher than saying "I feel sorry for you," but it still shows sympathy. If a boy gets in a fight at school, his father might say "What a pity" to mean that he wishes the boy had not gotten in the fight in the first place, but he is still sorry for his son.

pity: a feeling of sorrow and sympathy caused by the suffering of others: what a pity we can't be with friends. (Oxford Dictionary)

What a shame is a little colder. People use it to express a loss of respect for whatever they are talking about. For instance, if the boy is the one who started the fight, his father might say "What a shame." This means he has lost some respect for his son.

shame: loss of respect; dishonour: the incident had brought shame on his family. (Oxford Dictionary)

Nowadays, I hear "what a shame" more often because it only has three syllables instead of four. Instead of "what a pity," I usually hear "that's too bad" or something similar.