For a 3-week trip, the Interrail Global Pass is usually worth it just for the flexibility, especially if you change your plans last minute. However, you should check out this guide on
How to travel Europe on a budget to see a rough breakdown of costs before committing.