#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;

ll countFull(ll n) {
    string n_str = to_string(n);
    ll dig_n_2 = n_str.length() - 2;
    if (dig_n_2 == 0) return 0;

    //ll dig_n_2_m1 = dig_n_2 - 1;
    ll dig_n_2_m1 = (dig_n_2 - 1)/2;
    ll ret = 0;
    ll ten = 1;
    //rep(i, dig_n_2_m1 - 1) ten *= 10;
    rep(i, dig_n_2_m1 ) ten *= 10;
    ret = 9 * ten;
    return ret + countFull(n / 100);
}
int main() {
    ll n;
    cin >> n;

    string ns =to_string(n);
    if (ns.size() % 2 != 0){ 
        n=9;
        if (ns.size() != 1) rep(i, ns.size() - 2) {
                n *= 10;
                n += 9;
            }
        else {
            cout << 0 <<endl;
            return 0;
        }
    }

    ll cnt_fra;
    string n_str = to_string(n);
    string bef, aft;
    rep(i, n_str.length()) {
        if (i < n_str.length() / 2) bef.push_back(n_str[i]);
        else aft.push_back(n_str[i]);
    }
    ll be = stoll(bef);
    ll af = stoll(aft);

    ll ten = 1;
    rep(i, (n_str.length() / 2) - 1) ten *= 10;
    cnt_fra = min(be, af) - (ten - 1);
    if (to_string(min(be, af)).length() < n_str.length() / 2) {
        cnt_fra = 0;
    }
    if (be > af) {
        ten =1;
        rep(i,bef.size()-1) ten *= 10;
        cnt_fra = be - 1 - (ten-1) ;
    }

    cout << cnt_fra + countFull(n) << endl;
    
}
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
using vll = vector<ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
ostream& operator<<(ostream& os, lpair& h){ os << "(" << h.first << ", " << h.second << ")"; return os;}
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

void solve(){
    ll a[3];
    rep(i,0,3) cin >> a[i];
    sort(a, a+3);
    if(a[1] - a[0] == a[2] - a[1]){
        print("Yes");
    }else{
        print("No");
    }

}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}