Thermal Leptogenesis in f(R) cosmology