#include using namespace std; int nr,r,i,j,x,a[14],b[1004],k; char z; bool ok; int main() { // freopen ("keitai.in","r",stdin); // freopen ("keitai.out","w",stdout); scanf ("%c", &z); while (z!='\n') { a[++nr]=z-'0'; scanf ("%c", &z); } for (i=1;i<=8;i++) { for (k=0;k<=9;k++) { x=0; for (j=3;j<(i+2);j++) x=((x*10)+a[j]); x=((x*10)+k); for (j=(i+2);j<=9;j++) x=((x*10)+a[j]); ok=true; for (j=1;j<=r;j++) { if (b[j]==x) { ok=false; break; } } if (ok==true) b[++r]=x; } } printf ("%d", r); return 0; }