import java.util.Scanner; public class No149 { public static void main (String[] args){ Scanner sc =new Scanner(System.in); int aw=sc.nextInt() ,ab=sc.nextInt(); int bw=sc.nextInt(); int c=sc.nextInt(),d=sc.nextInt(); bw-=ab