Measurement of the proton and deuteron structure functions, F-2(p) and F-2(d), and of the ratio sigma(L)/sigma(T)