Kayzin plans to buy a luxury cruise ship which will cost N coins. But Kayzin didn't have enough coins, so Kayzin decided to start saving coins.
Kayzin will put 7 or 31 or 365 coins into his piggy bank each day. Now Kayzin wants to know at least how many days he will need to "exactly"(No more and no less) scrape together the money for buying a luxury cruise.
If Kayzin can't "exactly" scrape together the money for buying a luxury cruise, print -1.