use std::io;

fn main() {
    let mut N = String::new();
    let mut astring = String::new();

    io::stdin().read_line(&mut N).expect("fail");
    io::stdin().read_line(&mut astring).expect("fail");

    let N: u32 = N.trim().parse().unwrap();
    let mut a = vec![];
    let mut m: u64 = 1;

    for n in astring.split_whitespace() {
        let n: u64= n.parse().unwrap();
        a.push(n);
        m = m * n;
    }
    //println!("{}{:?}", N, a);
    m = m - 1;
    let mut sum: u64 = 0;
    for n in a.iter() {
        sum = sum + (m % n);
    }

    println!("{}", sum);
}