(NBC News) — Just like you, your dog knows when someone is speaking your native tongue or a foreign language, Hungarian researchers reported.

Brain scans from 18 dogs showed that some areas of the pups’ brains lit up differently depending on whether the dog was hearing words from a familiar language or a different one, according to a report published in NeuroImage.  

“Dogs are really good in the human environment,” said study author Laura Cuaya, a postdoctoral researcher at the Neuroethology of Communication Lab at Eötvös Loránd University in Budapest, Hungary.

“We found that they know more than I expected about human language,” Cuaya said. “Certainly, this ability to be constant social learners gives them an advantage as a species — it gives them a better understanding of their environment.”