import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.NoSuchElementException; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); //FastScanner scanner=new FastScanner(); PrintWriter out = new PrintWriter(System.out); int ans=0; long n=scanner.nextLong(); for(long i=1; i<=9; i++) { if(i*1000000001<=n) ans++; } for(int i=1; i<=9999; i++) { if(i%10==0) continue; List d=new ArrayList(); int x=i; while(x>0) { d.add(x%10); x/=10; } int a=i, p=1; for(int j=0; j Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next()); } }