Find the first valid position in a string that matches a simple character rule involving 'X'.
Valera and X
You are given a string consisting of uppercase Latin letters. Consider the positions of characters in the string from left to right, starting at 1.
Find the first position that satisfies the required condition for the character X in this problem and report it. The task is a straightforward scan of the string from left to right.
Because the exact contest wording is not provided here, the intended exercise is to practice simple string traversal, conditional checking, and output formatting.
Input Format
- A single line containing a string of uppercase Latin letters.
- The string length is positive.
Output Format
- Print the answer required by the condition in the string scan.
- For a practice version, this is typically a single integer position.
Constraints
- contains only uppercase English letters.
- Use linear scanning.
Example 1
Input
ABXCD
Output
3
Explanation
The first relevant character appears at position 3.
Premium problem context
Unlock deeper context for this problem
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.