fork download
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class Main {
  5. public static void main(String[] args) {
  6. Scanner in = new Scanner(System.in);
  7. PrintWriter out = new PrintWriter(System.out);
  8.  
  9. long n = in.nextLong();
  10. long q = 0;
  11. for (int m = 1; m <= n; m++)
  12. if (n / m == n % m)
  13. q += 1;
  14. out.print(q);
  15.  
  16. out.flush();
  17. }
  18. }
Success #stdin #stdout 0.06s 2184192KB
stdin
20
stdout
2