A rabbit loves cabbage and carrots. In a day, he eats either 9 carrots, or 2 heads of cabbage, or 1 head of cabbage and 4 carrots. But some days he only eats grass. Over the last 10 days, he ate a total of 30 carrots and 9 heads of cabbage. On how many of these 10 days did he eat only grass?