

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 150 点
問題文
英小文字からなる文字列 S が与えられます。ここで S の長さは 3 以上 100 以下です。
S はある 1 文字を除いて全て同じ文字で構成されています。
他のどの文字とも異なる文字は前から何文字目でしょうか。
制約
- S は 2 種類の英小文字からなる長さ 3 以上 100 以下の文字列
- S はある 1 文字を除いて全て同じ文字
入力
入力は以下の形式で標準入力から与えられる。
S
出力
答えを出力せよ。
入力例 1
yay
出力例 1
2
yay
の 2 文字目は、1 文字目とも 3 文字目とも異なります。
入力例 2
egg
出力例 2
1
入力例 3
zzzzzwz
出力例 3
6
Score: 150 points
Problem Statement
You are given a string S consisting of lowercase English letters. The length of S is between 3 and 100, inclusive.
All characters but one of S are the same.
Find x such that the x-th character of S differs from all other characters.
Constraints
- S is a string of length between 3 and 100, inclusive, consisting of two different lowercase English letters.
- All characters but one of S are the same.
Input
The input is given from Standard Input in the following format:
S
Output
Print the answer.
Sample Input 1
yay
Sample Output 1
2
The second character of yay
differs from the first and third characters.
Sample Input 2
egg
Sample Output 2
1
Sample Input 3
zzzzzwz
Sample Output 3
6