Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtoi ...
func Sliceconvtoi() []int {
	strs := strings.Split(sc.Text(), " ")

	var ints []int
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		ints = append(ints, x)
	}

	return ints
}

func main() {
	for sc.Scan() {
		d := Sliceconvtoi()
		fmt.Println(d[0] - d[1] - d[2] + d[3])
	}
}

C++: #include<iostream>
using namespace std;

int main()
{
    int n, a, b, c;

    cin >> n >> a >> b >> c;

    cout << n - ( a + b - c ) << endl;

    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int main(){
	int n,a,b,c;cin>>n>>a>>b>>c;
	cout<<n-(a+b-c)<<endl;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<functional>
#include<cmath>
#include<set>
#include<random>
#include<stdio.h>
#include<map>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const long long mod = 1000000007;
const long long inf = 11451419198109311;
const long double pi = 3.1415926535897932384626433;
typedef pair<int, int> P;
struct edge { int to, cost; };

signed main() {
	int n, a, b, c; cin >> n >> a >> b >> c;
	cout << n - a - b + c << endl;
}

C++: #include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF (long long)(1e18)
#define MOD (int)(1e9+7)

#define yn(f) ((f)?"Yes":"No")
#define YN(f) ((f)?"YES":"NO")

signed main(){
	cout<<fixed<<setprecision(7);

	int n, a, b, c;
	
	cin>>n>>a>>b>>c;
	
	cout<<n-(a+b-c)<<endl;
	
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#define int long long
using namespace std;
int a[114];
signed main() {
	int n, a, b, c;
	cin >> n >> a >> b >> c;
	cout << n - a - b + c << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <cstdio>
#include <cmath>
#include <set>
#include <utility>
#include <tuple>
#include <queue>

using namespace std;

int main()
{
    int n, a, b, c;
    cin>>n>>a>>b>>c;
    cout<<n-(a+b-c)<<endl;
    return 0;
}

C++: //↓template↓

#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
long long fac[200005], finv[200005], inv[200005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge> >G;

long long mod_pow(long long a, long long b) {
	long long res = 1;
	while (b) {
		if (b & 1) { res = res * a%MOD; }
		a = a * a%MOD;
		b >>= 1;
	}
	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

//↑template↑


int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << a - (b + c - d) << endl;
}

C++: #include <iostream>
using namespace std;

int main() {
  int N, A, B, C;
  cin >> N >> A >> B >> C;
  cout << N - (A + B - C) << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define int long long

signed main()
{
   int N,A,B,C; cin>>N>>A>>B>>C;
   cout<<N-((A+B)-C)<<endl;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	int e=b+c-d;
	cout<<a-e<<endl;
}

C++: #include<stdio.h>
int main()
{
	int n,a,b,c;
	scanf("%d %d %d %d",&n,&a,&b,&c);
	printf("%d\n",n-(a+b-c));
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iomanip>
#include<string>
#include <numeric>
using namespace std;
int a[810];
#define rep(i,n) for(int i=0;i<n;i++)
int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << a - (b + c - d) << endl;
}

C++: #include <bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
const ll INF=1LL<<30;
const ll LINF=1LL<<61;
const double eps=1e-9;
const ll MOD=1e9+7;
int main(){
    int n,a,b,c;cin>>n>>a>>b>>c;
    cout<<n-(a+b-c)<<endl;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
long long ni(long long ta, vector<long long> & v) {

}
long long rui(long long n, long long k, long long p) {
	if (k == 0) {
		return 1;
	}
	else {
		long long a = rui(n, k / 2, p);
		if (k % 2 == 0) {
			return (a*a) % p;
		}
		return (((a*a) % p)*n) % p;
	}
}
int main(){
	int n, a, b, c;
	cin >> n >> a >> b >> c;
	cout <<( n - (a + b)) + c << endl;
	return 0;
}

C++: N, A, B, C = [int(x) for x in input().split()]
ans = N - (A + B) + C
print(ans)

C++: #include <cstdio>
int main() {
    int n, a, b, c;
    scanf("%d %d %d %d", &n, &a, &b, &c);
    printf("%d\n", n-(a+b-c));
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int n,a,b,c;
  cin>>n>>a>>b>>c;
  cout<<n+c-(a+b)<<endl;
  return 0;
}

C++: #include<iostream> 
#include<string> 
#include<vector> 
#include<algorithm> 
using namespace std; 
int main()
{
	int a, b, c, d; 
	cin >> a >> b >> c >> d; 
	cout << a - (b + c - d) << endl;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;

int n, a, b, c;

int main() {
	cin >> n >> a >> b >> c;
	cout << n - (a + b - c) << endl;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
long long ni(long long ta, vector<long long> & v) {

}
long long rui(long long n, long long k, long long p) {
	if (k == 0) {
		return 1;
	}
	else {
		long long a = rui(n, k / 2, p);
		if (k % 2 == 0) {
			return (a*a) % p;
		}
		return (((a*a) % p)*n) % p;
	}
}
int main(){
	int n, a, b, c;
	cout << n - (a + b) + c << endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
    int n,a,b,c;    cin>>n>>a>>b>>c;
    cout<<n-(a+b-c)<<endl;

    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
#define int long long
#define All(v) (v.begin(),v.end())
int gcd(int a, int b) {
	if (b == 0)return a;
	return gcd(b, a%b);
}
int lcm(int a, int b) {
	return a / gcd(a, b)*b;
}
int modpow(int a,int b){
    if(!b)return 1;
    if(b%2)return modpow(a,b-1)*a%MOD;
    return modpow(a,b/2)*modpow(a,b/2)%MOD;
}
int fac(int a){
    int Ans=1;
    for(int i=1;i<=a;i++){
        Ans*=i;
        Ans%=MOD;
    }
    return Ans;
}//kaijo
int comb(int a,int b){
    return fac(a)*modpow(fac(a-b),MOD-2)%MOD*modpow(fac(b),MOD-2)%MOD;
}
signed main(){
	int n,a,b,c;
	cin>>n>>a>>b>>c;
	cout<<n-(a+b-c)<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)
#define lps(i,j,n) for(int i=j;i<n;i++)
#define fordebug int hoge;cin>>hoge;
#define DEKAI 1000000007;
#define INF (1<<28)
#define int long long
#define double long double
#define floot10 cout<<fixed<<setprecision(10)



signed main(){
  int n,a,b,c;
  cin>>n>>a>>b>>c;
  cout<<n-a-b+c<<endl;
  return 0;
}