#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(v) v.begin(),v.end()
#define PI acos(-1)
typedef  long long ll;
ll MOD=1000000007;

ll gcd(ll x,ll y){
   if(y==0) return x;
   else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
   return x/gcd(x,y)*y;
}


int main(){
   int n;
   cin>>n;
   string s=to_string(n);
   bool f=false;

   for(int i=0;i<=10;i++){
      string r;
      rep(j,i){
         r+='0';
      }
      r+=s;
      string c;
      rep(j,r.size()){
         c+=r[r.size()-j-1];
      }
      bool ff=true;
      rep(j,c.size()){
         if(r[j]!=c[j]){
            ff=false;
            break;
         }
      }
      if(ff){
         f=true;
         break;
      }
   }
   f? cout<<"Yes":cout<<"No";
   return 0;
}

#include <bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int getRand(int l, int r)
{
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}
  
#define int long long 
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define precise(x) fixed << setprecision(x) 

const int MOD = 1e9+7;

int mod_pow(int a,int b,int M = MOD)
{
    if(a == 0) return 0;
    b %= (M - 1);  //M must be prime here
    
    int res = 1;
    
    while(b > 0)
    {
        if(b&1) res=(res*a)%M;
        a=(a*a)%M;
        b>>=1;
    }
    
    return res;
}


void solve()
{
   string s;
   cin >> s;
    
   int res = 0;
   int n = s.length();
   
   vi fre(26,0); 
    
   for(int i=n-1;i>=0;i--)
   {
       fre[s[i] - 'a']++;
       
       if(i < n-1 && s[i] == s[i+1])
       {
           f(j,26) 
               if(s[i] - 'a' != j)
           {
               res += fre[j];
               fre[s[i] - 'a'] += fre[j];
               fre[j] = 0;
           }
       }
   }
    
   cout << res; 
    
    
}

signed main()
{
    fast;
    
    int t = 1;
    
//    cin >> t;
    
    while(t--)
        
    solve();
}
