#include<fstream>
#include<string>
#include<iostream>
using namespace std;
ifstream fin("xorin.in");
ofstream fout("xorin.out");

string nr, n;
int i;
char j;
string v[1000];
int k, l;

int main(){
    cin >> n;
    for (i = 2; i <= 9; i++)
        for (j = '0'; j <= '9'; j++){
            string p;
            p.append(n, 0, i);
            p += j;
            if (i != 9)
                p.append(n, i, 9 - i);
            //fout << p << '\n';
            int okadd = 1;
            for (l = 1; l <= k; l++)
                if (v[l] == p)
                    okadd = 0;
            if (okadd == 1){
                k++; v[k] = p;
            }
        }
    cout << k << '\n';
}