The integrated Sachs-Wolfe effect in f(R) gravity