Hi, Atom

The safe way would be :

1) to use a Voltage to frequency converter , LM 331 i.e., on the HV side. ( after applying a, say 100v, offset to your mains ...)

2) to transmit the freq. via an Opto-coupler ( 1Kv min rated !!! ... ) or an optic fiber to the measuring unit.

It will be much easier to do a freq counter with the Pic ...

Alain