Megan counted the glass beads that came in a package. She counted 5,000 green + 40 yellow + 300 pink + 3 black beads. How many beads were there in all?