How to measure the pion structure function at HERA