[USER (data scientist)]: Perfect! Now, let's calculate the number of affordable houses sold in the past 5 years. Please generate and display a DataFrame and an integer to analyze the subset of affordable houses of type 'h' from the 'melbourne_housing' dataset over the past 5 years, and save both the filtered dataset and the count of affordable houses to files.
My template of code snippet is:

---BEGIN CODE TEMPLATE---

import pandas as pd
import pickle

melbourne_housing = pd.read_csv("melb_data.csv") 

# YOUR SOLUTION BEGIN:
<code1>
[GENERATE YOUR CODE]
</code1>
# YOUR SOLUTION END:

print(affordable_houses)

# save data
pickle.dump(affordable_houses,open("./pred_result/affordable_houses.pkl","wb"))

print(number_of_affordable_houses)

# save data
pickle.dump(number_of_affordable_houses,open("./pred_result/number_of_affordable_houses.pkl","wb"))

---END CODE TEMPLATE---

[YOU (AI assistant)]: To calculate the number of affordable houses sold, you can use this code: 
