jiahuimbzuai/CoQuIR huggingface dataset:
//  [java]
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.next();
            int res[] = new int[26];
            int max[] = new int[26];

            Arrays.fill(res,-1);

            for(int i=0; i<s.length(); i++){
                if(res[s.charAt(i)-'a']==-1){
                    res[s.charAt(i)-'a']=i;
                    max[s.charAt(i)-'a']=i-0;
                }
                else if(res[s.charAt(i)-'a']>-1){
                    if(i-res[s.charAt(i)-'a']-1>max[s.charAt(i)-'a']){
                        max[s.charAt(i)-'a']=i-res[s.charAt(i)-'a']-1;
                    }
                    res[s.charAt(i)-'a'] = i;
                }
                if(i==s.length()-1){
                    for(int j=0; j<26; j++){
                        if(i-res[j]>max[j]){
                            max[j]=i-res[j];
                        }
                    }
                }
            }
            int min = 100000;
            for(int i=0; i<26; i++){
                if(max[i]<min){
                    min = max[i];
                }
            }

            out.println(min);

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}
//  [java]
import java.io.*;
import java.util.*;

public class Main {
    public static final long mod = (long)1e9+7;
    public static final long INF = Long.MAX_VALUE/2;
    public static final int inf = Integer.MAX_VALUE/2;
    
    static void solve(InputReader in, PrintWriter out){
        char[]  s = in.ns().toCharArray();
        int min = inf;
        for (int i = 0; i < 26; i++) {
            int max = 0, cur = 0;
            for (int j = 0; j < s.length; j++) {
                if(s[j]!='a'+i) cur++;
                else{
                    max = Math.max(max, cur);
                    cur = 0;
                }
            }
            max = Math.max(max, cur);
            min = Math.min(min, max);
        }
        out.println(min);
    }

    public static void main(String[] args){
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(in, out);
        out.close();
    }
    public static class InputReader{
        private BufferedReader br;
        private StringTokenizer st;
        public InputReader(InputStream is){
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }
        public String ns(){
            if(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (Exception e){
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public int ni(){
            return Integer.parseInt(ns());
        }
        public long nl(){
            return Long.parseLong(ns());
        }
        public double nd(){
            return Double.parseDouble(ns());
        }
        public char nc(){
            return ns().toCharArray()[0];
        }
        public int[] ni(int n){
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        public long[] nl(int n){
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }
        public double[] nd(int n){
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }
    }
}
//  [java]
import java.util.*;
import java.util.function.BiFunction;
import java.util.function.*;
import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        long j = 0 ;
        List<Character> ls = new LinkedList<>();
        for(char c: s.toCharArray())
            ls.add(c);

        System.out.println(ls.stream().distinct().map(e -> solve.apply(e,s)).min(Comparator.naturalOrder()).get());


    }



    static BiFunction<String,Character,String> step = (before,c) -> {
        String s1,s2;
        StringBuilder sb = new StringBuilder();
        if(before !=  null && before.length() > 0) {
            s1 = before.substring(0, before.length() - 1);
            s2 = before.substring(1,before.length());
            for(int i = 0;i < before.length() -1;i++)
            {
                if(c.equals(s1.charAt(i)) || c.equals(s2.charAt(i)))
                {
                    sb.append(c);
                }
                else
                    sb.append(s1.charAt(i));
            }
            return sb.toString();
        }
        else
            return "";
    };

    static Predicate<String> check = s -> {
        List<Character> ls = new LinkedList<>();
        for(char c: s.toCharArray())
            ls.add(c);
        if(ls.stream().distinct().count() == 1)
            return true;
        else
            return false;
    };
    static BiFunction<Character,String,Integer> solve = (c,s) -> {
        for (int i = 0; ; i++) {
            if (check.test(s))
                return i;
            else
                s = step.apply(s,c);
        }
    };
}
//  [java]
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static final Scanner s=new Scanner(System.in);
	public static void main(String[] __){
		String str=s.next();
		HashMap<Character,ArrayList<Integer>> h=new HashMap<>();
		for(char c='a';c<='z';c++){
			h.put(c,new ArrayList<>());
			h.get(c).add(-1);
		}
		
		for(int i=0;i<str.length();i++){
			final char c=str.charAt(i);
			h.get(c).add(i);
		}
		
		for(char c='a';c<='z';c++){
			h.get(c).add(str.length());
		}
		System.out.println(h.values().stream().mapToInt(o->{
			int max=-114514;
			for(int i=1;i<o.size();i++)
				max=Math.max(max,o.get(i)-o.get(i-1));
			return max;
		}).min().getAsInt()-1);
	}
}
//  [java]
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().solve();
	}

	void solve(){
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		
		int MinCount=100;
		for(int i=0;i<s.length();i++) {
			char target=s.charAt(i);
			
			String t2=s;
			int count=0;
			while(true) {
				String t1="";
				for(int j=0;j<t2.length()-1;j++) {
					if(t2.charAt(j)==target) {
						t1+=t2.charAt(j);
					}else if(t2.charAt(j+1)==target){
						t1+=t2.charAt(j+1);
					}else {
						t1+=t2.charAt(j);
					}
				}
				boolean flag=true;
				for(int j=0;j<t2.length()-1;j++) {
					if(t2.charAt(j)!=t2.charAt(j+1))flag=false;
				}
				if(flag)break;
				count++;
				t2=t1;
			}
			MinCount=Math.min(count, MinCount);
		}
		System.out.println(MinCount);
	}
}
//  [cpp]
#include<cstdio>
#include<algorithm>
#define MN 1111
using namespace std;

int mmh=1e9;
char s[MN];
int main(){
	scanf("%s",s);
	for (int i='a';i<='z';i++){
		int la=-1,ans=0,j;
		for (j=0;s[j];j++)
		if (s[j]==i){
			if (ans<j-la-1) ans=j-la-1;
			la=j;
		}
		if (ans<j-la-1) ans=j-la-1;
		if (mmh>ans) mmh=ans;
	}
	printf("%d\n",mmh);
}
//  [cpp]
#include <stdio.h>

char s[105];

int main(){
    scanf("%s", s);
    int n;
    for(n=0; s[n]; n++);
    int res = 1e9;
    for(char ch='a'; ch<='z'; ch++){
        int cons = 0, mx = 0;
        for(int i=0; i<n; i++){
            if(s[i] == ch){
                if(cons > mx) mx = cons;
                cons = 0;
            } else{
                cons++;
            }
        }
        if(cons > mx) mx = cons;
        if(mx < res) res = mx;
    }
    printf("%d", res);
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define SZ(x) ((int) (x).size())
using namespace std;

int main() {
    #ifdef LOCAL_RUN
    freopen("task.in", "r", stdin);
    freopen("task.out", "w", stdout);
    //freopen("task.err", "w", stderr);
    #endif // ONLINE_JUDGE
    ios::sync_with_stdio(false);
    cin.tie(0);

    string s;
    cin >> s;

    int cnt[26] = {0};
    int last[26] = {-1};
    for (int i = 0; i < 26; ++i) {
        last[i] = -1;
    }
    for (int i = 0; i < SZ(s); ++i) {
        int c = s[i] - 'a';
        cnt[c] = max(cnt[c], i - last[c] - 1);
        last[c] = i;
    }
    for (int i = 0; i < 26; ++i) {
        cnt[i] = max(cnt[i], SZ(s) - last[i] - 1);
    }
    cout << *min_element(cnt, cnt + 26) << '\n';
}
//  [cpp]
#include <bits/stdc++.h>

#define int long long

using namespace std;

int u[3001][101];
int ok[101];

int get (string a, char po) {
	memset (u, 0, sizeof u);
	memset (ok, 0, sizeof ok);
	int mn = 0;
	for (int i = 0;i < a.size ();i ++) {
		if (a[i] == po) mn ++;
	}
	if (mn == a.size ()) return 0;
	string ne = "";
	bool ko = 0;
	for (int i = 0;i < a.size ();i ++) {
		if (a[i] == po) {
			ok[i - 1] = 1;
			ok[i] = 1;
		}	
	}
	for (int i = 0;i < a.size () - 1;i ++) {
		if (ok[i] == 1) {
			ne += po;
		}
		else {
			ne += a[i];
		}
	}
	return get (ne, po) + 1;
}

 main () {
	ios_base::sync_with_stdio (0);
	cin.tie (0);
	string a;
	cin  >> a;
	int anq = 1e9 + 7;
	for (char f = 'a';f <= 'z';f ++) {
		anq = min (anq, get (a, f));
	}
	cout << anq;
	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
#define sqr(x) ((x)*(x))
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define ld long double
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define debuge cerr<<"isok"<<endl
#define debug(x) cerr<<#x<<"="<<x<<endl
#define SS second
#define FF first
#define ls (k<<1)
#define rs (k<<1|1)
#define inf 0x3f3f3f3f
#define clr(a,x) memset(a,x,sizeof(a))
#define cpy(a,x) memcpy(a,x,sizeof(a))
#define file(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout);
using namespace std;

const int N=100005,M=100005,mod=1e9+7;
template<class T> inline void gmin(T &x,const T &y){if(x>y) x=y;}
template<class T> inline void gmax(T &x,const T &y){if(x<y) x=y;}
inline void ch(int &x,int y){x=(x+y)%mod;}
inline void read(int &x){
	x=0;char ch=getchar(),rev=0;
	while(ch>'9'||ch<'0') rev=(ch=='-'),ch=getchar();
	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	x=rev?-x:x;
}
inline int exp(int x,int y){
	int ans=1;
	while(y){
		if(y&1) ans=(ll)ans*x%mod;
		x=(ll)x*x%mod;y>>=1;
	}return ans;
}

int n,a[N],b[N],c[N];
char s[N];

int main(){
#ifdef rqgao2014
	freopen("input.txt","r",stdin);
#endif
	scanf("%s",s+1);n=strlen(s+1);
	for(int i=1;i<=n;i++) a[i]=s[i]-'a';
	bool isok=1;
	for(int i=2;i<=n;i++) 
		if(a[i]!=a[i-1]) isok=0;
	if(isok){puts("0");return 0;}
	int ans=inf;
	for(int cc=0;cc<26;cc++){
		cpy(b,a);
		for(int i=1;i<=n;i++){
			bool isok=1;
			cpy(c,b);
			for(int j=1;j<=n-i;j++)
				if(c[j]==cc||c[j+1]==cc) b[j]=cc; else b[j]=c[j];
			for(int j=1;j<=n-i;j++)
				if(b[j]!=cc) isok=0;
			if(isok) gmin(ans,i);
		}
	}
	printf("%d\n",ans);
	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

void solve() {
  string s;
  cin >> s;
  int n = s.size();
  int ans = INF;
  string y = "";
  rep(i,n) y = y + s[0];
  if (y == s) {
    cout << 0 << endl;
    return;
  }
  rep(i,n) {
    char c = s[i];
    int cnt = 0;
    string t = s;
    for(;;) {
      cnt++;
      string temp = "";
      string x = "";
      rep(j,t.size()-1) {
        if (t[j] == c || t[j+1] == c) temp = temp + c;
        else temp = temp + t[j];
        x = x + c;
      }
      if (x == temp) break;
      t = temp;
    }
    ans = min(ans, cnt);
  }
  cout << ans << endl;
}

int main() {
  solve();
  return 0;
}
//  [c]
#include<stdio.h>
#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
int main(int argc, char const *argv[]){
	char s[101],t;
	int ans=100,i=0,j,m,r,f;
	scanf("%s",s);
	while(s[i]!='\0'){
		t=s[i];
		m=0;
		j=0;
		f=0;
		while(s[j]!='\0'){
			if(s[j]==t && f==1) m=max(m,r);
			else if(s[j]!=t){
				if(f==1) r++;
				else{
					r=1;
					f=1;
				}
			}
			if(s[j]==t) f=0;
			j++;
		}
		if(f==1) m=max(m,r);
		ans=min(ans,m);
		i++;
	}
	printf("%d\n",ans);
	return 0;
}
//  [c]
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdio.h>

int main(int argc, const char * argv[]) {
    char s[101];
    scanf("%s",s);
    long l=strlen(s);
    int alp[26]={0},ans=200;
    for(int i=0;i<26;i++){
        int count=0;
        for(long j=l-1;j>=0;j--){
            if(s[j]=='a'+i){
                alp[i]=alp[i]<count?count:alp[i];
                count=0;
            }else{
                count++;
            }
            if(j==0){
                alp[i]=alp[i]<count?count:alp[i];
            }
        }
        ans=ans<alp[i]?ans:alp[i];
    }
    
    printf("%d",ans);
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#define rep(i,n)for(int i=0;i<(int)(n);i++)
main(){
char s[101];
scanf("%s",s);
int l=strlen(s),min=200;
rep(i,l){
	int ans=0,t=0;
	rep(j,l+1){
		if(j==l||s[i]==s[j]){if(ans<t)ans=t;t=0;}
		else t++;
	}
	if(ans<min)min=ans;
}
printf("%d\n",min);
}
//  [c]
#include <stdio.h>

char s[128];

int last[256], max[256];

int main(void) {
	int i, len,  kotae;
	if (scanf("%127s",s) != 1) return 1;

	for (i = 0; i < 256; i++) {
		last[i] = -1;
	}

	for (i = 0; s[i] != '\0'; i++) {
		int idx = (unsigned char)s[i];
		if (i - last[idx] - 1 > max[idx]) max[idx] = i - last[idx] - 1;
		last[idx] = i;
	}

	len = i;
	for (i = 0; i < 256; i++) {
		if (len - last[i] - 1 > max[i]) max[i] = len - last[i] - 1;
	}

	kotae = len;
	for (i = 0; i < 256; i++) {
		if (max[i] < kotae) kotae = max[i];
	}

	printf("%d\n", kotae);
	return 0;
}

/*

s e r v a l
|/|/|/|/|/
s r v v l
|/|/|/|/
s v v v
|/|/|/
v v v

j a c k a l
|/|/|/|/|/
a a c a a
|/|/|/|/
a a a a

各文字は後ろへは拡散できない
ある位置の文字に統一したい → その長さになるまで待たないといけない

*/
//  [c]
#include<stdio.h>

int main(){
  int counter=0;
  char s[101];
  scanf("%s",s);
  while (s[counter]!='\0'){ counter++;}

  int min=100;
  for (int i = 0; i < counter; i++)
  {
    int j=0,max=0;
    while (j<counter)
    {
      int between=0;
      while (s[i]!=s[j]&&j<counter){ between++; j++;}
      if (max<between){ max=between;}
      j++;
    }
    if (min>max){ min=max; }
  }
  
  printf("%d",min);
  
  return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
typedef long long ll;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define max(l,r) (l>r?l:r)
#define min(l,r) (l<r?l:r)
#define swap(l,r) {ll tp=l;l=r;r=tp;}
const ll MOD = 1000000007;

int main(){
    char s[105]; scanf("%s",s);
    int n = strlen(s);

    int ans = MOD;
    rep(i,26){
        int cnt[105] = {0};
        rep(j,n){
            if(s[j] != ('a'+i)){
                if(j > 0) cnt[j] = cnt[j-1] + 1;
                else cnt[j] = 1;
            }
        }
        int mx = 0;
        rep(j,n) mx = max(mx, cnt[j]);
        ans = min(ans, mx);
    }
    printf("%d\n",ans);
}
//  [javascript]
module.exports=function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)n.d(t,o,function(r){return e[r]}.bind(null,o));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=0)}([function(e,r,n){n(1)(n(2).readFileSync("/dev/stdin","UTF-8"))},function(e,r){e.exports=function(e){for(var r=e.split("\n")[0],n=r.length,t={},o=0;o<n;o++){var u=r[o];t[u]||(t[u]=[],0!=o&&t[u].push(0)),t[u].push(o)}var a={};for(var i in t){var f=t[i];f.slice(-1)!=n-1&&f.push(n-1);for(var l=-1,c=1;c<f.length-1;c++){var p=f[c]-f[c-1];0!=f[c-1]&&(p-=1);var s=f[c+1]-f[c];f[c+1]!=n-1&&(s-=1);var v=Math.max(p,s);v>l&&(l=v)}-1==l&&(l=n+1),a[i]={Ta:l}}var d=n+1,b=0;for(var y in a){b+=1;var g=a[y].Ta;g<d&&(d=g)}1!=b?console.log(d):console.log(0)}},function(e,r){e.exports=require("fs")}]);
//  [javascript]
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var s = o.a(1);
  var l = s.length;
  var ans = l;
  for(var i = 0; i < 26; i++){
    var mx = 0;
    var n = 0;
    for(var j = 0; j < l; j++){
      if(s[j].charCodeAt()-97 === i){
        if(n > mx)mx = n;
        n = 0;
      }else n++;
    }
    if(n > mx)mx = n;
    if(mx < ans)ans = mx;
  }
  return ans;
}
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
    var t;
    var input = input.split("\n");
    t = input[0];
    var min_try_count = -1;



    for (var i = "a".charCodeAt(0); i < "z".charCodeAt(0) + 1; i++) {
        //t_primeが単一の文字のみになっていればbreak
        if (/^([a-z])\1*$/.test(t)) {
            min_try_count = 0;
            break;
        }

        var tmp = t;
        var t_prime = "";
        var c = String.fromCharCode(i);
        var try_count = 0;

        while (true) {

            //文字数-1回分ループをまわす。
            //t'のi文字目について、tのi文字目またはi+1文字目を見る。
            //cと一致する文字があれば、その文字をt'のi文字目とする。
            //一致しなければ、tのi文字目をt'のi文字目とする。
            for (var j = 0; j < tmp.length-1; j++) {
                if (c === tmp.charAt(j)) {
                    t_prime += c;
                }
                else if (c === tmp.charAt(j + 1)) {
                    t_prime += c;
                }
                else {
                    t_prime += tmp.charAt(j);
                }
            }

            try_count++;

            //console.log(t_prime);
            //t_primeが単一の文字のみになっていればbreak
            if (/^([a-z])\1*$/.test(t_prime)) {
                break;
            }
            tmp = t_prime;
            t_prime = "";

        }

        if (min_try_count == -1 || min_try_count > try_count) {
            min_try_count = try_count;
        }

    }
    console.log(min_try_count);

}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("");
    
    let list = {};
    let stringCnt = [...new Set(S)].length;
    let cnt = 0;
    
    if(stringCnt === 1) {
        console.log(0);
        return;
    }
    
    for(let i in S) {
        if(list[S[i]]) {
            list[S[i]]++;
        } else {
            list[S[i]] = 1;
        }
    }
    
    for(let key of Object.keys(list)) {
        let previous = S;
        
        while(stringCnt !== 1) {
            let next = [];
            
            for(let i=0; i<previous.length-1; i++) {
                if(previous[i] === key || previous[~~i+1] === key) {
                    next.push(key);
                } else {
                    next.push(S[i]);
                }
            }
            
            previous  = next.join("");
            stringCnt = [...new Set(previous)].length;
        }
        
        cnt = Math.max(previous.length, cnt);
        
        stringCnt = [...new Set(S)].length;
    }
    
    console.log(S.length - cnt)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("");
    
    let list = {};
    let stringCnt = [...new Set(S)].length;
    let cnt = 0;

    for(let i in S) {
        if(list[S[i]]) {
            list[S[i]]++;
        } else {
            list[S[i]] = 1;
        }
    }
    
    for(let key of Object.keys(list)) {
        let previous = S;
        
        while(stringCnt !== 1) {
            let next = [];
            
            for(let i=0; i<previous.length-1; i++) {
                if(previous[i] === key || previous[~~i+1] === key) {
                    next.push(key);
                } else {
                    next.push(S[i]);
                }
            }
            
            previous  = next.join("");
            stringCnt = [...new Set(previous)].length;
        }
        
        cnt = Math.max(previous.length, cnt);
        stringCnt = [...new Set(S)].length;
    }
    
    console.log(S.length - cnt);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
var output;
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す
//1:数値へ変換 2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字に分割 7:1文字に分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main() {
  var s = myconv(next(),6);
  var list = {};
  for(var i = 0; i < s.length; i++){
    if(list[s[i]] == null){
       list[s[i]] = 1;
    }else{
       list[s[i]]++;
    }
  }
  var maxKeys = [];
  var max = 0;
  var keys = Array.from(Object.keys(list));
  if(keys.length == 1){
     myout(0);
    return;
  }
  
  var output = 107;
  for(var j = 0; j < keys.length; j++){
    var tmpKey = keys[j];
    var tmpS = Object.assign([],s);
    var count = 0;
  while(!check(tmpS,tmpKey)){
    for(var i = 0; i < tmpS.length; i++){
      if(tmpS[i+1] == tmpKey){
         tmpS[i] = tmpKey;
      }
    }
    tmpS.pop();
    count++;
  }
    output = Math.min(output,count);
  }
  myout(output);
}
function check(str,chr){
    var ret = true;
    for(var i = 0; i < str.length; i++){
      if(str[i] != chr){
         ret = false;
      }
    }
    return ret;
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func floatScanner() float64 {
	n, _ := strconv.ParseFloat(Scanner(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func stringSliceScanner(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scanner()
	}
	return a
}
func intSliceScanner(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = intScanner()
	}
	return a
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}

var mod int

func main() {
	mod = 1000000007
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	s := Scanner()
	d := make(map[string]struct{})
	for _, r := range s {
		d[string(r)] = struct{}{}
	}
	ans := mod
	for k, _ := range d {
		x := strings.Split(s, k)
		a := 0
		for i := 0; i < len(x); i++ {
			a = larger(a, len(x[i]))
		}
		ans = smaller(ans, a)
	}
	fmt.Println(ans)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func init() {
	const maxWord = (1 << 30)
	buf := []byte{}
	sc.Buffer(buf, maxWord)
	sc.Split(bufio.ScanWords)
}

func input() string {
	sc.Scan()
	return sc.Text()
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func solve(s string) int {
	ret := len(s)
	letters := ""
	for i, _ := range s {
		if !strings.Contains(letters, s[i:i+1]) {
			letters += s[i : i+1]
		}
	}

	for _, spliter := range letters {
		maxSeries := 0
		tmpSeries := 0
		for _, v := range s {
			if v == spliter {
				maxSeries = max(maxSeries, tmpSeries)
				tmpSeries = 0
			} else {
				tmpSeries++
			}
		}
		maxSeries = max(maxSeries, tmpSeries)
		ret = min(ret, maxSeries)
	}

	return ret
}

func main() {
	s := input()
	fmt.Println(solve(s))
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer([]byte{}, 1000000)

	t := getString()

	ok := true
	for i := 0; i < len(t); i++ {
		if t[0] != t[i] {
			ok = false
			break
		}
	}
	if ok {
		out(0)
		return
	}

	N := len(t)
	cnt := 1
	a := make([]byte, 0)
	a = append(a, t[N-1])
	N--
LOOP:
	for i := 0; i < len(t); i++ {
		a = append(a, t[N-1])
		//out(i, N, "-------", string(a))
		for _, v := range a {
			ok = true
			for j := 0; j < N; j++ {
				check := false
				for k := 0; k <= cnt; k++ {
					//out(j, k, string(t[k]))
					if t[j+k] == v {
						check = true
						break
					}
				}
				if check == false {
					ok = false
					break
				}
			}
			if ok == true {
				break LOOP
			}
		}
		N--
		cnt++
	}

	out(cnt)
}
//  [go]
package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)

	ans := int(1e9)
	for i := 0; i < 26; i++ {
		c := byte('a' + i)

		cnt := 0
		cur := s
		for {
			ok := true
			for j := 0; j < len(cur); j++ {
				if cur[j] != c {
					ok = false
				}
			}
			if ok {
				break
			}

			cnt++
			tmp := ""
			for j := 0; j < len(cur)-1; j++ {
				if cur[j] == c || cur[j+1] == c {
					tmp += string(c)
				} else {
					tmp += string(cur[j])
				}
			}
			cur = tmp
		}

		if ans > cnt {
			ans = cnt
		}
	}

	fmt.Println(ans)
}
//  [go]
package main

import (
	"fmt"
	"strings"
)

func main() {
	var s string
	fmt.Scan(&s)
	ans := 100
	for v := 'a'; v <= 'z'; v++ {
		if strings.Contains(s, string(v)) {
			sum := fa(s, v)
			if sum < ans {
				ans = sum
			}
		}
	}
	fmt.Println(ans)
}

func fa(s string, v rune) int {
	sum := 0
	for len(s) != strings.Count(s, string(v)) {
		sum++
		temp := ""
		for i := 1; i < len(s); i++ {
			if rune(s[i]) == v || rune(s[i-1]) == v {
				temp += string(v)
			} else {
				temp += string(s[i])
			}
		}
		s = temp
	}
	return sum
}
//  [ruby]
s = gets.chomp.split("")
ans = []
("a".."z").each do |alphabet|
  max = 0
  current = 0
  s.each do |c|
    if c == alphabet
      max = current if max < current
      current = 0
    else
      current += 1
    end
  end
  max = current if max < current
  ans << max
end
puts ans.min
//  [ruby]
s = gets.chomp

h = Hash.new {[-1, 0]}
s.each_char.with_index do |c, i|
    h[c] = [i, [h[c][1], i - h[c][0] - 1].max]
end

puts h.values.map{|x, y| [y, s.size - x - 1].max}.min
//  [ruby]
S = gets.chomp
min = 99999999999
arr = *("a".."z")
arr.each{|alp|
	tmp = S.split(alp).map{|s| s.size}.max
	tmp = 0 if tmp.nil?
	min > tmp ? min = tmp : 0
}
puts min
//  [ruby]
s = gets.chomp

ans = 10**9
s.split('').each do |ss|
  cnt = 0
  l = s.size
  w = s

  while w.scan(/#{ss}/).count != l
    tmp = ''
    (0..l-2).each do |i|
      tmp += w[i]==ss || w[i+1]==ss ? ss : w[i]
    end
    w = tmp
    l -= 1
    cnt += 1
  end
  ans = cnt if cnt < ans
end

puts ans
//  [ruby]
s=gets.chomp
res=s.size+1
s.chars do |c|
    t=s.dup
    n=t.size
    cnt=0
    while t.chars.uniq.size>1
        (0...n-1-cnt).each{|i| t[i]=t[i+1] if t[i+1]==c }
        t[-1]=''
        cnt+=1
    end
    res=cnt if res>cnt
end
puts res
//  [ruby]
s = gets.chomp

ans = 10 ** 20
s.chars.each do |a|
  t = s.dup
  tmp = 0
  while t.chars.uniq.count != 1 do
    (0..t.size-2).each do |i|
      if t[i] == a || t[i+1] == a
        t[i] = a
      end
    end
    t.chop!
    tmp += 1
  end
  ans = [ans, tmp].min
end
puts ans
//  [rust]
#![allow(unused_imports)]

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

use std::{i32, i64, u32, u64, f64};
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::io::{stdout, Write, BufWriter};
use std::mem::{swap};

fn main() {
    input! {
        s: String,
    }
    let n = s.len();
    let mut prevs = HashMap::new();
    let mut maxs = HashMap::new();
    for (i, c) in s.chars().enumerate() {
        if prevs.contains_key(&c) {
            let p = prevs.get_mut(&c).unwrap();
            let m = maxs.get_mut(&c).unwrap();
            *m = max(*m, i - *p - 1);
            *p = i;
        } else {
            prevs.insert(c, i);
            maxs.insert(c, i);
        }
    }
    for (c, p) in prevs {
        let m = maxs.get_mut(&c).unwrap();
        *m = max(*m, n - p - 1);
    }
    println!("{}", maxs.values().min().unwrap());
}
//  [rust]
use std::io::Read;
use std::cmp::min;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let s: Vec<char> = iterator.next().unwrap().chars().collect();

    let mut ans = 100;
    for c in 'a' as u8 .. 'z' as u8 + 1 {
        let c = c as char;
        if !s.contains(&c) {
            continue;
        }

        let mut t = s.clone();
        let mut count = 0;
        while !t.iter().all(|it| *it == c) {
            for i in 0 .. t.len() - 1 {
                if t[i] == c || t[i + 1] == c {
                    t[i] = c;
                }
            }
            t.pop();
            count += 1;
        }
        ans = min(ans, count);
    }

    return ans.to_string();
}
//  [rust]
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(dead_code)]

fn main() {
    let s: Vec<char> = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().chars().collect()
    };

    let N = s.len();
    let ans = (0..26).map(|k| {
        let c = (('a' as u8) + (k as u8)) as char;
        let mut dp = s.clone();
        let mut res = 10000;
        for i in 0..N {
            if dp.iter().all(|&x| x == c) { res = i; break; }
            for j in 0..(N - 1 - i) {
                dp[j] = if dp[j + 1] == c { c } else { dp[j] };
            }
            for j in (N - 1 - i)..N {
                dp[j] = c;
            }
        }
        res
    }).min().unwrap();

    println!("{}", ans);
}
//  [rust]
use std::io::{BufRead, Write};
use std::io;
use std::usize;

fn solve<R: BufRead, W: Write>(mut input: R, mut output: W) {
    let mut st = String::new();
    input.read_line(&mut st).unwrap();
    let mut fin: usize = usize::MAX;
    let targets: Vec<char> = (0..26).map(|n| (n as u8 + 'a' as u8) as char).collect();
    for target in targets {
        let mut result: usize = 0;
        let mut s = st.trim().to_owned();
        while !s.chars().all(|x| x == s.chars().next().unwrap()) {
            s = (0..s.len() - 1)
                .map(|x| if s.chars().nth(x).unwrap() == target {
                    target
                } else {
                    s.chars().nth(x + 1).unwrap()
                })
                .collect();
            result += 1;
        }
        if result < fin {
            fin = result
        };
    }
    writeln!(output, "{}", fin).unwrap();
}

fn main() {
    let stdin = io::stdin();
    let stdout = io::stdout();
    solve(stdin.lock(), stdout.lock());
}

#[cfg(test)]
mod tests {
    fn test(input: &str, output: &str) {
        let mut v: Vec<u8> = Vec::new();
        ::solve(input.as_bytes(), &mut v);
        assert_eq!(String::from_utf8(v).unwrap(), output);
    }
    #[test]
    fn case1() {
        test("serval\n", "3\n");
    }
    #[test]
    fn case2() {
        test("jackal\n", "2\n");
    }
    #[test]
    fn case3() {
        test("zzz\n", "0\n");
    }
    #[test]
    fn case4() {
        test("whbrjpjyhsrywlqjxdbrbaomnw\n", "8\n");
    }
}
//  [rust]
use proconio::input;
use proconio::marker::{Bytes, Chars};
use std::cmp::{max, min};

fn main() {
    input! {
        s: String,
    }
    let mut ans = s.len() - 1;
    for c in b'a'..=b'z' {
        ans = min(ans, s.split(c as char).map(|s| s.len()).max().unwrap());
    }
    println!("{}", ans);
}
//  [swift]
import Foundation

extension String {
    func toIntList() -> [Int] {
        return self.split(separator: " ").map{Int($0)!}
    }
    
    func toList() -> [String] {
        return self.map{String($0)}
    }
    
    func count(c:Character) -> Int{
        var result = 0

        for e in self{
            if e == c{
                result += 1
            }
        }
        return result
    }

    func counter() -> Dictionary<Character, Int>{
        var result:[Character:Int] = [:]
        
        for c in self{
            guard let _ = result.index(forKey: c) else {
                result[c] = 1
                continue
            }
            result[c]! += 1
        }
        return result
    }
}

extension Int {
    func toBin() -> String {
        return String(self, radix: 2)
    }
    
    func toD() -> Double {
        return Double(self)
    }
}

extension Double {
    func toI() -> Int {
        return Int(self)
    }
}

extension Array where Element: Equatable{
    func count(n:Self.Element) -> Int{
        var result = 0
        for e in self{
            if e == n{
                result += 1
            }
        }
        return result
    }
}


func agc016a() -> Int{
    var S = readLine()!
    let N = S.count
    let counter = S.counter()
    var answer = 999
    for c in counter.keys{
        var t = S
        var a = 0
        while t.count(c: c) != t.count {
            var tmp = ""
            for i in 0..<t.count-1 {
                let index = t.index(t.startIndex, offsetBy: i)
                let indexPlus = t.index(t.startIndex, offsetBy: i+1)
                if t[index] == c || t[indexPlus] == c{
                    tmp.append(c)
                } else {
                    tmp.append(t[index])
                }
            }
            a += 1
            t = tmp
        }
        answer = min(a, answer)
    }
    return answer
}

print(agc016a())
//  [typescript]
import * as fs from 'fs';

export class Reader {
    lines: string[];
    currentLine: number;

    constructor() {
        this.lines = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        this.currentLine = 0;
    }

    readLine(): string {
        return this.lines[this.currentLine++];
    }

	readChars(): string[] {
		let S = this.readLine();
		return new Array(S.length).fill(null).map((_, i) => S.charAt(i));
	}

    readInt(): number {
        return Number(this.readLine());
    }

    readInts(): number[] {
        return this.readLine().split(" ").map(Number);
    }
}

let reader = new Reader();

let S = reader.readLine();
let alphabets = new Set(S);
let closestIndex:Map<string, number> = new Map();
let maximumLength:Map<string, number> = new Map();

alphabets.forEach((alphabet) => {
	closestIndex.set(alphabet, S.length);
	maximumLength.set(alphabet, 0);
});

for(let i=S.length-1; i>=0; i--) {
	if (closestIndex.get(S[i])-i-1 > maximumLength.get(S[i])) {
		maximumLength.set(S[i], closestIndex.get(S[i])-i-1);
	}
	closestIndex.set(S[i], i);
}

alphabets.forEach((alphabet) => {
	if (closestIndex.get(alphabet) > maximumLength.get(alphabet)) {
		maximumLength.set(alphabet, closestIndex.get(alphabet));
	}
});

let minMax: number = Infinity;
maximumLength.forEach((value) => {
	if (value < minMax)
		minMax = value;
});

console.log(minMax);
//  [python]
from sys import stdin
import numpy as np
#L = int(stdin.readline().rstrip().split()[0])
A = [int(x) for x in stdin.readline().rstrip().split()]
# N, X = [int(x) for x in stdin.readline().rstrip().split()]
# S = stdin.readline().rstrip().split()[0]

ans = "Yes"

if A[0]!=A[1]:
  ans ="No"
elif A[0]!=A[2]:
  ans="No"
elif A[1]!=A[2]:
  ans="No"
print(ans)
//  [python]
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
 
A, B, C = [int(x) for x in input().split()]
 
if A == B and B == C:
    print ("Yes")
else:
    print ("No")
//  [python]
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
#n = ip()                                     #入力整数1つ
a,b,c= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
if a == b and b==c:j(1)
j(0)
//  [java]
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> elements = Arrays.asList(sc.nextLine().split(" "));
		
		Main checker = new Main();
		String result = checker.checkEquilateralTriangle(elements);
		
		System.out.println(result);
		sc.close();
	}
	
	public String checkEquilateralTriangle(List<String> elements) {
		long count = elements.stream().distinct().count();
		return count == 1 ? "Yes" : "No";
	}

}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
struct Fast {
    Fast() {
        std::cin.tie(0);
        ios::sync_with_stdio(false);
        cout.precision(20);
    }
} fast;

/* define */
#define FOR(I, X, Y) for(long long(I) = (X); (I) < (Y); (I)++)
#define REP(I, X, Y) for(long long(I) = (Y)-1; (I) >= (X); (I)--)
#define ALL(X) (X).begin(), (X).end()
#define pb push_back
#define COUNT(V, X)                                                            \
    (upper_bound((V).begin(), (V).end(), X) -                                  \
     lower_bound((V).begin(), (V).end(), X))
#define debug(x) cerr << #x << ':' << x << endl;
#define DEBUG(v)                                                               \
    {                                                                          \
        cerr << #v << ':';                                                     \
        for(auto xv : v) cerr << xv << ' ';                                    \
        cerr << endl;                                                          \
    }
#define Yes(X) cout << (X ? "Yes" : "No") << endl;
#define YES(X) cout << (X ? "YES" : "NO") << endl;
#define ctoi(C) (C - '0')
#define pow2(x) ((long long)((long long)1 << x))

/* alias */
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using pi = pair<int, int>;
using pl = pair<long long, long long>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const long long dx[] = {1, 0, -1, 0};
const long long dy[] = {0, 1, 0, -1};
const long long dx8[] = {1, 1, 0, -1, -1, -1, 0, 1};
const long long dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const long long dx9[] = {1, 1, 0, -1, -1, -1, 0, 1, 0};
const long long dy9[] = {0, 1, 1, 1, 0, -1, -1, -1, 0};
const int INF = 1000000007;
const long long LINF = 1000000000000000007;

/* func */
template <typename T1, typename T2> inline bool chmin(T1 &a, const T2 &b) {
    if(a > b) a = b;
    return a > b;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, const T2 &b) {
    if(a < b) a = b;
    return a < b;
}
long long max(long long x, int y) {
    return max(x, (long long)y);
}
long long max(int x, long long y) {
    return max((long long)x, y);
}
long long min(long long x, int y) {
    return min(x, (long long)y);
}
long long min(int x, long long y) {
    return min((long long)x, y);
}

/* liblary */

/* main */

signed main() {
    auto start = std::chrono::system_clock::now();
    int input[3];
    for(auto &x : input) cin >> x;
    random_device rnd;
    while(true) {
        auto end = std::chrono::system_clock::now();
        auto dur = end - start;
        auto msec =
            std::chrono::duration_cast<std::chrono::milliseconds>(dur).count();
        if(msec > 1998) break;
        int idx1 = rnd() % 3;
        int idx2 = rnd() % 3;
        if(input[idx1] != input[idx2]) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}
//  [cpp]
#include <iostream>

using namespace std;

int main()
{
    int a, b, c;
    cin >> a >> b >> c;

    if( (a == b) && (b == c) ){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}
//  [cpp]
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define sort(a)         sort((a).begin(), (a).end())
#define uniq(a)         SORT(a);(a).erase(unique((a).begin(), (a).end()), (a).end())
#define reverse(a)      reverse((a).begin(), (a).end())
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define Yes()           printf("Yes\n")
#define No()            printf("No\n")
#define YES()           printf("YES\n")
#define NO()            printf("NO\n")
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }

using namespace std;
using ll = long long;
using P = pair<ll,ll>;

const ll MOD = 1000000007; // 10^9 + 7

void solve() {
  int a, b, c; cin >> a >> b >> c;
  if (a == b && b == c) Yes();
  else No();
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}
//  [c]
#include <stdio.h>

int main(void) {
	int A, B, C;
	if (scanf("%d%d%d", &A, &B, &C) != 3) return 1;
	puts(A == B && B == C ? "Yes" : "No");
	return 0;
}
//  [c]
#include<stdio.h>
int main(void){
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);
  if((a==b)&&(b==c)&&(c==a)){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.split("\n");
    const N = arg[0].split(" ");
    const set = new Set(N);
    
    console.log(set.size === 1 ? "Yes" : "No");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function main(input) {
    const args = input.split(' ');

    var A = parseInt(args[0], 10);
    var B = parseInt(args[1], 10);
    var C = parseInt(args[2], 10);

    if( A === B && A === C && B === C) {
        console.log('Yes')
    } else {
        console.log('No')
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

import "fmt"

func main() {
	// Code for A - Regular Triangle
	var A, B, C int
	fmt.Scanf("%d %d %d", &A, &B, &C)

	if A == B && B == C {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
package main

import (
  "fmt"
)

func main() {
  var a, b, c int
  fmt.Scanf("%d %d %d", &a, &b, &c)
  
  ans := "No"
  if a == b && b == c {
    ans = "Yes"
  }
  fmt.Printf("%s\n", ans)
}
//  [ruby]
nums = gets.split.map(&:to_i)
if nums.all? { |n| n == nums[0] }
  puts 'Yes'
else
  puts 'No'
end
//  [ruby]
class Problem
  attr_accessor :a, :b, :c, :n, :m, :h, :w
  def initialize
    @a,@b,@c = gets.to_s.split.map{ |v| v.to_i }
  end

  def solve
    a == b && b == c
  end

  def show(ans)
    puts ans ? "Yes" : "No"
  end
end

Problem.new.instance_eval do
  show(solve)
end
//  [ruby]
a,b,c = `dd`.split.map &:to_i
puts a == b && b == c ? "Yes" : "No"