help calculating AC capacitor
A capacitor on the AC side won't do what you seem to think it will do.  

A capacitor will pass AC.  

If you put a large capacitor across your AC source, it will in effect be a (near) short circuit  - cue sparks and bangs and tripped circuit breakers.

If you put a large capacitor in series with your AC source, then still won't help.  It will act like a series resistor and reduce the voltage to your device.

If you want to use a capacitor to power the machine for a little while, then you will have to do it on the DC side.

You're going to need a much larger capacitor than you think, though.

Your formula assumes that you can get all of the energy back out of the capacitor that you put in.  That's only the case, though, if you can discharge the capacitor to 0V.

You can't do that.  Your machine needs some minimum voltage to operate.  You have the normal operating voltage, and the minimum voltage.  You can only use that voltage difference when calculating the energy you can use from the capacitor.

Better to use a UPS that will maintain the AC output regardless of the input.