Question : How long do most people visit Barcelona?
Answer : Of course you're not most people, but if you were, you'd stay roughly 11 days.
Question : If your plans are flexible, have you considered changing your departure day?
Answer : The cheapest day to fly in June is Thursday. Having flexibility in your travel plans means you can save more, so be sure to plan ahead when possible.