How to count occurences at the end of the list
<p>I would like to count the same occurences at the end of the list in python. It's very trivial to do, but I'm interested in some of your interesting solutions as well. List can contain only '1' or '2' item. Result must be in [3,4,5]. If less than 2 quit, if more than 5 return 5.</p>

<p><strong>Examples:</strong></p>

<p>Let's have </p>

<pre><code>  L = [1,1,2]
  Result: None (quit)

  L = [1,2,1,1]
  Result: None (quit)

  L = [1,2,1,1,1]
  Result: 3

  L = [1,1,2,2,2,2]
  Result: 4

  L = [1,2,1,1,1,1,1,1]
  Result: 5
</code></pre>
