Cost Basis of Home After Multiple Moves

I moved to North Carolina for a job out of college in 1971. After renting for a couple years I bought my first house in 1974; moved into a nicer house in 1977; was transferred and bought another house in 1981; transferred again and moved to another state in 1983; again in 1985; again in 1990; again in 1997; and the final move to my current house in 2004.  I recall my first house was an assumed mortgage and I think it cost ~$28,000.  I made a little on it when I moved and each time I moved I made money, but it wasn't a lot of money; I just didn't lose any.  My current house cost $240K and is worth around $500K.  

What is my cost basis?  Do I just use the price of the last move (240 plus capital improvements, if any) or do I have to go back and figure out the adjusted basis for each one?