using System;
using System.Linq;
using static System.Console;
class Program
{
static void Main()
int x=int.Parse(ReadLine());
var t=x.ToString().Select(n=>(int)n).Reverse().ToList();
WriteLine((t.FindIndex(n=>n==t.Max())+1).ToString());
}
using System;
using System.Linq;
using static System.Console;
class Program
{
static void Main()
{
int x=int.Parse(ReadLine());
var t=x.ToString().Select(n=>(int)n).Reverse().ToList();
WriteLine((t.FindIndex(n=>n==t.Max())+1).ToString());
}
}