Well, the word NAND should scream Sum of Products (SOP), so try to get your function to that point, then you can modify it further. After playing around with your function, you should get something like: