fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut k = String::new(); std::io::stdin().read_line(&mut k).ok(); let k: usize = k.trim().parse().unwrap(); let mut result = 0usize; for i in 2..=(k as f64).sqrt() as usize { if k % i > 0 { continue; } let ac = i; let bd = k / i; let ac = if ac <= n+1 { ac - 1 } else if ac > 2*n { 0 } else { 2*n + 1 - ac }; let bd = if bd <= n+1 { bd - 1 } else if bd > 2*n { 0 } else { 2*n + 1 - bd }; if i == k / i { result += ac * bd; } else { result += 2 * ac * bd; } } println!("{}", result); }