A photon is a singular particle of light. Photons are miniscule and move incredibly quickly. A joule is a measurement of energy. Each tiny photon contains a certain amount of energy that can be calculated using three factors. These factors are the electromagnetic wavelength, Planck's constant and the speed of the photon.
Multiply 6.626 * 10^-34 by the speed of electromagnetic-field propogation in the medium your problem states. In most cases, this number will be the speed of light in a vacuum, which is 2.998 * 10^8 meters per second.
For example -- operating in a vacuum:
(6.626 * 10^-34)*(2.998 * 10^8 meters per second) =1.9864748 × 10^-25 m/s
Divide the result by the electromagnetic wavelength, in meters, of the photon.
In the example, where the wavelength is 10 m:
(1.9864748 × 10^-25 m/s)/10 meters = 1.9864748 × 10^-26 Hz
Note: Hz is the same as 1/seconds
Multiply the result by the number of photons that you want to measure. The result will be the joules of energy contained in the photons.
In the example, we multiply by 12 photons:
(1.9864748 × 10^-26 Hz)*12 photons = 2.38376976 × 10^-25 joules