fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner in = new Scanner(System.in);
  10. int[] folder = new int[10];
  11. long N = in.nextLong();
  12. while(N != 0) {
  13. folder[(int)N % 10]++;
  14. N /= 10;
  15. }
  16. int sum = 0;
  17. for (int i = 0; i < 10; i++)
  18. if(folder[i]!=0) sum++;
  19. System.out.print(sum);
  20. }
  21. }
Success #stdin #stdout 0.07s 2184192KB
stdin
11222
stdout
2