From the census, Miriam was born between 1765-1770.
There were three Johns listed in Kittery in the 1790 census. One was listed as John 3, either he was the son of a John or he could have been called that to distinguish him from the other two Johns in the census.
There was a John 3rd 1737-1825 of Kittery, but his father was named James.
Do you have any ages and other names such as John the 3rds wife and children that might provide more clues?