#include <iostream>
using namespace std;
const int TEN = 10;
int main() {
int n;
cin >> n;
int count = 0;
while (n > 10) {
--n;
if ((n % TEN) * (n / TEN % TEN) == 0) {
++count;
}
}
while (n >= 0) {
--n;
if (n % TEN == 0) {
++count;
}
}
cout << count;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmNvbnN0IGludCBURU4gPSAxMDsKIAppbnQgbWFpbigpIHsKCWludCBuOwoJY2luID4+IG47CglpbnQgY291bnQgPSAwOwoJd2hpbGUgKG4gPiAxMCkgewoJCS0tbjsKCQlpZiAoKG4gJSBURU4pICogKG4gLyBURU4gJSBURU4pID09IDApIHsKCQkJKytjb3VudDsKCQl9Cgl9Cgl3aGlsZSAobiA+PSAwKSB7CgkJLS1uOwoJCWlmIChuICUgVEVOID09IDApIHsKCQkrK2NvdW50OwoJCX0KCX0KCWNvdXQgPDwgY291bnQ7CglyZXR1cm4gMDsKfQ==