count distinct values over columns
A correlated subquery against a VALUES table should do the trick:
SELECT
    t.A, t.B, t.C,
    (SELECT COUNT(DISTINCT v.n) FROM (VALUES(t.A),(t.B),(t.C)) AS v(n)) AS cnt
FROM table t

If you wanted separate calculations on the values such as both counting and summing, you could use a lateral join (a.k.a APPLY) over VALUES instead:
SELECT A, B, C ,D, E, v.countDistinct, v.countNotNull, v.Total
FROM  test,
LATERAL (
    SELECT COUNT(DISTINCT v.n), COUNT(v.n), SUM(v.n)
    FROM (VALUES (A),(B),(C), (D), (E)) AS v(n)
) AS v(countDistinct, countNotNull, Total)