Swimming on period?

I'm going on a beach holiday with my friends next week and I know I'm going to be on my period all 5 days of it :( 
Is it possible to go swimming on your period? I've never done it and I know it says you can use a tampon on boxes but is it dangerous? I've never used a tampon before properly. The only time I did it it hurt a lot so I don't think I can use them. 
Would appreciate any advice!