You have a line of cards consisting of hearts on one side and spades on the other.

You are allowed to choose a card and flip that card and all of the cards to the right of it.

For instance, if you chose the 4th card in the next line you would flip the rightmost 6 cards:

This line of cards has 8 s and 7 s.


How many cards should you flip to get the greatest number of s in the line?