Brainteaser: Probability

Round 1: Hedge Fund Quantitative Research

Question: You have a deck of black and red cards (you know the number of cards for each color). You draw cards one by one. You can stop any time you want. If you guess the color of next card correctly, you win 1 dollar. Cards are not returned to the deck after being drawn. What is the optimal stopping rule in terms of maximizing expected payoff? Also, what is the expected payoff following this optimal rule?