Experimental determination of the structure function of the pion