Teething or hungry?

How can you tell if a baby is chewing on it's hand put of hunger or if it's still hungry? She is 5 months old and breastfed.