import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long a = scan.nextLong(); long b = scan.nextLong(); long count = 0; List list = new ArrayList(); for(long i = b ; i <= a ; i++){ if(a%i == 0){ list.add(i); } } for(long num:list){ if(num%b == 0){ count++; } } System.out.println(count); } }