How many photons are produced in a laser pulse of 0.308 J at 401 nm?

each photon has energy of E = hv = h * c/λ

so, you will have
0.308 * λ/(hc)