Skip to main content
Back to problems
Codeforces
Easy
Arrays
Strings
Valera and X

Find the first valid position in a string that matches a simple character rule involving 'X'.

Acceptance 0%
Problem Statement

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

  • 1s1 \le |s|
  • ss contains only uppercase English letters.
  • Use linear scanning.
Examples
Sample cases returned by the problem API.

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.

Guided hints
Editorial and discussion links
Concept map and variants
Sign in to unlock
Track your progress
Sign in to bookmark this problem, save notes, and manage its revision plan.