This problem is based on a Jane Street interview problem described here.
You repeatedly roll a fair six-sided die and keep a running score equal to the sum of non-six rolls. After each non-six roll, you may stop and take the current score. If any roll is a 6, the game ends immediately and your payoff is 0. What is the smallest current score at which stopping is optimal?