use proconio::input; // use std::cmp; //use std::collections::VecDeque; // use std::collections::HashSet; fn main() { input! { n: i32, } let mut result = 0; for i in 1..n+1 { if i % 3 == 1 { result += i; } else if i % 3 == 2 { result += i.pow(2); } else if i % 3 == 0 { result += i.pow(20223); } } println!("{}", result) }