fn double(x: Int) -> Int {
    x * 2
}

fn add(a: Int, b: Int) -> Int {
    a + b
}

fn main() {
    let mut sum = 0
    for i in 0..1000000 {
        sum = add(sum, double(i))
    }
    println(sum)
}
