Stochastic background of gravitational waves “tuned” by f(R) gravity