use std::io::{read_to_string, stdin};

fn main() {
    let temp = read_to_string(stdin()).unwrap();
    let mut iter = temp
        .split_ascii_whitespace()
        .map(|x| x.parse::<usize>().unwrap());
    let n = iter.next().unwrap();
    let mut s = 0;
    for i in 1..=n {
        s += 3 * (i + 1) * i / 2;
    }
    println!("{}", s);
}
