use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;

#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn gcd(a: usize, b: usize) -> usize{
    if b == 0{
        return a;
    }

    return gcd(b, a%b);
}

fn lcm(a: usize, b: usize) -> usize{
    return a*b /gcd(a, b);
}

//21:37
fn main(){
    let n: usize = read_as_vec()[0];
    let a: Vec<usize> = read_as_vec();

    let mut m = 1;


    for &elem in &a{
        m = lcm(elem, m);
    }

    m = m -1;

    let mut ans = 0;
    for &elem in &a{
        ans += m%elem;
    }
    println!("{}", ans);
}
