use proconio::input; fn main() { input! { n: u64, } let c = n.count_ones(); println!("{}", c * (c - 1) / 2); }