If you want to have a fancy solution:
```python
return sum(1 for x in iterable if f(x))
```