<?php
$n = trim(fgets(STDIN));
$a = explode(' ', trim(fgets(STDIN)));
$v = trim(fgets(STDIN));
echo array_sum($a) - $v;
?>