Ham and potatoes au gratin