I encourage people to try getting locally roasted beans. The quality of the brew is far above what you can get at any supermarket brand.
It does generally cost a bit more, but I don't think it's unmanageable. If optimizing caffeine intake for cost, the economical choice is probably to ditch coffee for caffeine pills.