Sam is twice the age of John. Two years ago, he was 40 more than John's age. How old is John?