Find the different letter You may have seen puzzles like this:


  Find the 0:
  OOOOOOOOOOOOOOOOOOOO0OOOOOOOOOOOOOOOOOO


The challenge is to write a program that finds the index of the different letter given an image.

Input

Input will be an Image. The image will consist of one line of black text in the Helvetica 24 pt. font on a white background. The text will consist from a selection of two characters: one character that is repeated, and one character that appears only once. For instance:



Output

Output will be an Integer, the index of the different character. In the example above, the output will be 4. (Note that indices of a string start at 0)

Program Specifications

As per usual for code golf, the shortest program wins.



Test Cases

 =&gt; 10
 =&gt; 11
 =&gt; 5
 =&gt; 16
 =&gt; 10
 =&gt; 21
 =&gt; 20
 =&gt; 13
 =&gt; 11
 =&gt; 4
 =&gt; 7
Dyalog APL, 31 32 bytes
{1⍳⍨+⌿∘.≡⍨{⍵/⍨~∧⌿⍵}¨⍵⊂⍨2&gt;/∧⌿1,⍵}

⎕IO←0 to get indices starting with 0 (per OP), and which is anyway default in many APL systems.
1,⍵ prepend a column of white pixels (to ensure margin)
∧⌿ boolean for each column if all-white (vertical AND-reduction)
2&gt;/ boolean at each character's left edge (pair-wise greater-than)
⍵⊂⍨ split into blocks beginning at each TRUE.
{…}¨ for each block
∧⌿⍵ boolean for each column if all-white (vertical AND-reduction)
⍵/⍨~ columns that are not [all-white]
∘.≡⍨ match each element to all elements
+⌿ number of blocks identical to each block (vertical plus-reduction)
1⍳⍨ index of first one (i.e. unique element)
Assumes the image is black (0) and white (1) pixels in the matrix I, and that there is at least one all-white pixel column between characters.
      f←{1⍳⍨+⌿∘.≡⍨{⍵/⍨~∧⌿⍵}¨⍵⊂⍨2&gt;/∧⌿1,⍵}

&quot;!I!!&quot;:
      ⊢I←6 12⍴(13/1),(22⍴0 1 1),(5/1),0,(8/1),(10⍴0 1 1),13/1
1 1 1 1 1 1 1 1 1 1 1 1
1 0 1 1 0 1 1 0 1 1 0 1
1 0 1 1 0 1 1 0 1 1 0 1
1 1 1 1 0 1 1 1 1 1 1 1
1 0 1 1 0 1 1 0 1 1 0 1
1 1 1 1 1 1 1 1 1 1 1 1
      f I
1

&quot;mmnmm&quot;:
      ⊢I←7 31⍴(94/1),0 0,(∊0 1⌽¨2/⊂12⍴6↑1 0 1 1),0 1,(62⍴1 1 1,(⊢,⌽)(14⍴0 1)),33/1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 1 0 1 1 0 0 1 0 1 1 0 0 0 1 1 0 0 1 0 1 1 0 0 1 0 1 1 1
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1     
      f I
2