Start by reading the input and storing it.
Then process the input repeatedly, trying each combination.
For example, if you take the first shops coupon, then you cannot take a coupon from the next two, but you can take the fourth shops coupon if you want - 7. If you do, then you will have 2 coupons in total. So one combination is 0, 3 (because indexes start at zero)
If you don't take the forth shop coupon, you could take the fifth: 9
So you will end up with combinations
0, 3
0, 4
0, 5
0, 6, 7
0, 6, 8
0, 6, 9
1
2, 6, 7
2, 6, 8
2, 6, 9
...
Your job is to work out what the longest such combination may be: 3 in this case.
That's the "brute force and ignorance" approach - and while it will work, it won't be particularly efficient, particularly for large datasets. It may be that your test will require a better approach, such as a weighted graph:
Longest path problem - Wikipedia[
^] but that will be a lot more complex to implement.
Either way, you'll get no code: this is a test of your abilities, not mone!