How do I figure an adjusted cost base for this?

We purchased property in 1977 and lived in house until 1987 when we separated a parcel off original property and built new home where we lived until 2017.  How do I figure an adjusted cost base for this?