#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;

char toch (int dig)
{
    switch (dig)
    {
        case 0 : return '0';
        case 1 : return '1';
            case 2 : return '2';
            case 3 : return '3';
            case 4 : return '4';
            case 5 : return '5';
            case 6 : return '6';
            case 7 : return '7';
            case 8 : return '8';
            case 9 : return '9';
    }
    
    return 0;
}

int main(int argc, const char * argv[]) {
    
    string number="";
    
    cin >> number;
    
    set <vector<char>> totals;
    
  
    for(int i=2; i<10; ++i)
        for(int j=0; j<10; ++j)
        {
            vector<char>pos;
            
            
            for(int k=0; k<number.size(); ++k)
            {
                if (i == k)
                {
                    pos.push_back(toch(j));
                    pos.push_back(number[k]);
                }
                else pos.push_back(number[k]);
            }
            if (i == 9)
            {
                pos.push_back(toch(j));
            }
            totals.insert(pos);
        }
    
    cout << totals.size();
    return 0;
}