#include <iostream>
#include <math.h>

using namespace std;

int main()
{
	long long N;
	cin >> N;
	int cont = 0;

	int i = 1;
	long long M = 11;
	while(M <= N)
	{
		cont++;
		i++;
		int dig = to_string(i).length();
		M = i * pow(10, dig) + i;
	}

	cout << cont << endl;

	return 0;
}
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;


#define mod 998244353
#define int long long
#define INF 1e9
#define endl "\n"
#define pi 2*acos(0.0)//M_PI in cmath lib
#define sp(x) setprecision(x)
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define L length()

const int32_t N=25;

int find(int a,vector<int>&link){
    int x=a;
    while(link[x]!=x){
        x = link[x];
    }
    return x;
}
    
void unite(int a,int b,vector<int>&link,vector<int>&size){
    a = find(a,link);
    b = find(b,link);
    if(size[a]<size[b])
        swap(a,b);
    size[a] += size[b];
    link[b]=a;
}

int gcd(int a, int b){
    if(b==0)return a;
    return gcd(b, a%b);
}
 
std::vector<int> seive(int n){
    std::vector<int> v(n+1,0);
    std::vector<int> p;
    for(int i=2;i*i<=n;i++){
        if(v[i]==0){
            p.pb(i);
            for(int j=i;j<=n;j+=i)v[i]=1;
        }
    }
    return p;
}
 
bool cmp(pair<pair<int,int>,int> a, pair<pair<int,int>,int> b){
    return a.F.F<b.F.F;
}

bool pal(string s){
    int i=0,j=s.length()-1;
    while(i<j){
        if(s[i]!=s[j])return false;
        i++,j--;
    }
    return true;
}

void solve(){
    int n;cin>>n;
    if(n==0){cout<<"Yes";return;}
    int z=0;
    int t=n;
    int r=t%10;
    while(r==0 && t>0){
        z++;
        t/=10;
        r=t%10;
    }
    string s="";
    while(z--)s+='0';
    s+=to_string(n);
    if(pal(s))cout<<"Yes";
    else cout<<"No";
}

signed main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL); 
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r" , stdin);
    freopen("outit.txt", "w", stdout);
    #endif
    int t=1;
    // cin>>t;
    while(t--){
        solve();
        cout<<endl;
    }
}