Charlotte and Barry are each assigned a paper for a class they share. Charlotte decides to write 12 pages at a time while Barry decides to write 2 pages at a time. If they end up writing the same number of pages, what is the smallest number of pages that the papers could have had?