A measurement of the photon structure function F2