Can someone please explain how to figure this out. Is there a formula?

On August 2, 2012, Wendy purchased a new office building for $3.7 million. On October 1, 2012, she began to rent out office space in the building. On July 15, 2016, Wendy sold the office building. Determine Wendy's cost recovery for 2012. Determine Wendy's cost recovery for 2016.