The formula used for vaccine efficacy is as follows:
VE = (ARU - ARV) / ARU
(VE: vaccine efficacy, ARU: attack rate in unvaccinated participants, ARV: attack rate in vaccinated participants)
This is equivalent to:
VE = 1 - RR
(RR: Relative risk)
The attack rate is simply the number of new cases divided by the total group size.
ARV = 39 / 21,314 = 0....
The paper itself describes how this is calculated (see the Methods section), but also see this Q&A at Biology.SE talking more broadly about how efficacy has been defined in these vaccine trials:
They define efficacy as the fraction of infected in the vaccine compared to placebo categories, normalized for ...