stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define  ft  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define  ll  long long

#define  pi  pair<int,int>

#define  pb  push_back

#define  F   first

#define  S   second

const int N=2e5+2;

int main()

{

    ft

    ll t,i,j,n,m,s=0;

    cin>>n;

    for(i=0; i<n; i++)

    {

        cin>>m;

        s+=(m-1);

    }

    cout<<s<<"\n";

    return 0;

}




// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <algorithm>



using namespace std;



//long long __lcm (int (*A)[3001], int N){

//    long long lcm = (*A)[0];

//    for (int i = 0; i < N; i++)

//        lcm = (((*A)[i]*lcm) / __gcd((long long)(*A)[i], lcm));

//    return lcm;

//}



int main(){

    int N; cin >> N; int A, f = 0;

    for (int i = 0; i < N; i++) {cin >> A; f += A;}

    //long long m = __lcm(&A, N)-1;

    //for (int i = 0; i < N; i++) f += m % A[i];

    cout << f-N << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):


#include<iostream>

#include<cstdio>

#include<queue>

#include<cstring>

#include<algorithm>

#include<vector>

#include<map>

#include<sstream>

typedef long long LL;

using namespace std;

 

LL a[3010];

int main()

{

    int n;

    scanf("%d",&n);

    int s=0;

    for(int i=1;i<=n;i++)

        scanf("%lld",&a[i]),s+=a[i]-1;

 

    printf("%d\n",s);

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>



using namespace std;



int main() {

	int n, ans = 0, t;

	cin >> n;

	for (int i = 1; i <= n; ++i) {

		cin >> t;

		ans += t - 1;

	}

	cout << ans;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

int n, mx = 0 , mn = INT_MAX;

int sum = 0;

cin>>n;

for(int i = 0 ; i<n ; i++){

    int x;

    cin>>x;

    sum += (x-1);

}

cout<<sum<<endl;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <string.h>

#include <algorithm>

#include<iostream>

#include<math.h>

#include<sstream>

#include<vector>

#include<stack>

using namespace std;

#define maxn 3005

int main(){

	int n;

	cin>>n;

	int s=0;

	int a[maxn]={0};

	for(int i=0;i<n;i++)

		cin>>a[i];

	for (int j = 0; j < n; j++)

        s += a[j]-1;

    cout << s<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

            int m;

            cin>>m;

            long long sum=0,ans=0;

            long long a[m+1],b[m+1];

            memset(b,0,sizeof(b));

            for(int j=1;j<=m;j++)

            {

                cin>>b[j];

                sum+=b[j];



            }

         //   cout<<sum<<endl;



               printf("%lld\n",sum-m);



}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// #include<bits/stdc++.h>

#include<vector>

#include<iostream>

using namespace std;

// #pragma GCC optimize("-O3")



#ifndef ConanYu

#define CPPIO

#endif

#ifdef CPPIO

#define endl "\n"

#endif



#define push_back emplace_back

template<typename T>

class List : public vector<T>

{

public:

//  new

    template<typename... U>

    List(const U &... tail) : vector<T>(0)

    {

        pb(tail...);

    }



//  push_back

    void pb() {}

    template<typename... U>

    void pb(const T & head, const U &... tail)

    {

        this->push_back(head);

        pb(tail...);

    }



//print

    void print()

    {

        const int LEN = this->size();

        for (int i = 0; i < LEN; i++)

        {

            cout << (*this)[i] << (i == LEN - 1 ? '\n' : ' ');

        }

    }

};





typedef long long ll;

typedef pair<int, int>pii;

typedef pair<long long, long long>pll;

typedef long double ld;



pll exgcd(const long long x, const long long y)

{

    if (!y)

    {

        return make_pair(1, 0);

    }

    pll cur = exgcd(y, x % y);

    return make_pair(cur.second, cur.first - (x / y) * cur.second);

}



const long long __mod__ = 998244353;

long long mmod()

{

    return 1LL;

}

template <typename T, typename ...U>

long long mmod(const T &head, const U &... tail)

{

    return (head * mmod(tail...)) % __mod__;

}



long long mod(long long x, long long p = __mod__)

{

    return ((x % p) + p) % p;

}



void print() {}

template <typename T, typename... U>

void print(const T &head, const U &... tail)

{

    cout << head << (sizeof...(tail) ? ' ' : '\n');

    print(tail...);

}



#ifdef ConanYu

#define debug(...) print(__VA_ARGS__)

#else

#define debug(...) 0

#endif



inline long long fmul(long long a, long long c, const long long& Mod)

{

    a %= Mod, c %= Mod ;

    return (a * c - (long long)(((long double) a * c + 0.5) / Mod) * Mod) % Mod ;

}



long long gcd(long long x, long long y)

{

    return y == 0 ? x : gcd(y, x % y);

}



void solve();

int main()

{

#ifdef ConanYu

    freopen("test.txt", "r", stdin);

    // freopen("out.txt", "w", stdout);

    // freopen("2.in", "r", stdin);

    // freopen("2.out", "w", stdout);

    clock_t st = clock();

#endif



#ifdef CPPIO

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

#endif



    solve();



#ifdef ConanYu

    clock_t ed = clock();

    cerr << "time: " << ((ed - st) * 1.0 / CLOCKS_PER_SEC) << endl;

#endif

    return 0;

}



// *********************************************************************************************************



ll a[3333];

void solve()

{

    int n;

    cin >> n;

    int sum = 0;

    for(int i = 0; i < n; i++)

    {

        cin >> a[i];

        sum += a[i];

    }

    cout << (sum - n) << endl;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main()

{



    int n,k,ans=0;

    scanf("%d",&n);

    for(int i=0;i<n;++i)

    {

        scanf("%d",&k);

        ans+=k-1;

    }

    printf("%d\n",ans);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

using namespace std;

const int maxn = 3010;

int a[maxn];

int main()

{

    int n; scanf("%d", &n);

    int sum = 0;

    for(int i = 0; i < n; i++){

        int t;

        scanf("%d", &t);

        sum += (t-1);

    }

    printf("%d\n", sum);

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

using namespace std;

typedef long long ll;

ll num[3010];

int main()

{

	int n;

	scanf("%d", &n);

	for (int i = 0; i < n; i++)

	{

		scanf("%lld", &num[i]);

		num[i]--;

	}



	ll res = 0;

	for (int i = 0; i < n; i++)

	{

		res += num[i];

	}

	printf("%lld", res);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

int main () {

	int n,x,i,sum=0;

	cin>>n;

	for(i=0;i<n;i++){

    cin>>x;

    sum+=x;

	}

	sum-=n;

	cout<<sum;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	

	int input;

	scanf("%d", &input);

	

	int arr[3005];

	int sum = 0;

	for(int i = 0; i < input; i++){

		scanf("%d", &arr[i]);

		sum += arr[i];

	}

		

	printf("%d\n", sum - input);

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int N, sum = 0;



int main() {

    cin >> N;

    int a[N];

    for (int i = 0; i < N; i++) cin >> a[i];

    for (int k = 0; k < N; k++) {

        sum += a[k] - 1;

    }

    cout << sum << endl;

    

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	

	int input;

	scanf("%d", &input);

	

	int arr[3005];

	int sum = 0;

	for(int i = 0; i < input; i++){

		scanf("%d", &arr[i]);

		sum += arr[i];

	}

		

	printf("%d\n", sum - input);

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll inf=0x3f3f3f3f;

ll a[3005];

int main(){

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

    ll n;

    cin>>n;

    ll sum=0;

    for(int i=1;i<=n;++i){

        cin>>a[i];

        sum+=a[i]-1;

    }

    cout<<sum<<endl;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	

	int input;

	scanf("%d", &input);

	

	int arr[3005];

	int sum = 0;

	for(int i = 0; i < input; i++){

		scanf("%d", &arr[i]);

		sum += arr[i];

	}

		

	printf("%d\n", sum - input);

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream> 

#include<string>

#include<cstring>

#include<algorithm>

#include<cstdio>

#include<cmath>

#include<set>

#include<map>

#include<vector>

#include<queue>

#include<sstream>

using namespace std;

 

#define sf scanf

#define pf printf

#define pfn printf("\n");

#define pfk printf(" ");

#define pf0 printf("0");

#define pf1 printf("1");

#define ll long long

#define sfd(n) scanf("%d",&n);

#define sfdd(n,m) scanf("%d%d",&n,&m);

#define sfld(n) scanf("%lld",&n);

#define sfldd(n,m) scanf("%lld%lld",&n,&m);

#define sflf(n) scanf("%lf",&n);

#define sflff(n,m) scanf("%lf%lf",&n,&m);

#define sfc(n) scanf("%c",n);

#define sfcc(n,m) scanf("%c%c",n,m);

#define sfs(n) scanf("%s",n);

#define sfss(n,m) scanf("%s%s",n,m);

#define pfd(n) printf("%d",n);

#define pfld(n) printf("%lld",n);

#define pflf(n) printf("%lf",n);

#define pfc(n) printf("%c",n);

#define pfs(n) printf("%s",n);

 

#define csh(a,n) memset(a,n,sizeof(a));

int arr[1001][1001];

int main(){

	int t,n,m;

	cin>>n;

	int sum=0;

	for(int i=0;i<n;i++){

		int a;

		cin>>a;

		sum+=a-1;

	} 

	cout<<sum<<endl;

} 

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int n,a,sum=0;

	scanf("%d",&n);

	for(int i=0;i<n;i++)

	{

		scanf("%d",&a);

		sum+=a;

	}

	sum-=n;

	printf("%d\n",sum);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
/*g++ main.cpp -o main.out*/

/*./main.out*/



#include <map>

#include <set>

#include <list>

#include <cmath>

#include <ctime>

#include <deque>

#include <queue>

#include <stack>

#include <bitset>

#include <cctype>

#include <cstdio>

#include <string>

#include <vector>

#include <climits>

#include <cstdlib>

#include <cstring>

#include <fstream>

#include <iomanip>

#include <sstream>

#include <iostream>

#include <iterator>

#include <algorithm>

using namespace std;



#define LL long long

#define LD long double

#define Mod 1000000007

#define L_Mod 17100000013



const double eps = 1e-9;

const int INF = 0x3f3f3f3f;

const double PI = 3.1415926535;



#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);



#define ree(a,n) memset(a,n,sizeof(a));



#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))

#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))

#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))



LL lcm(LL a,LL b)

{

    return a*b/__gcd(a,b);

}



LL a[100005];



int main()

{

    NO_TLE

    int n;

    cin>>n;

//    rep(i,n)cin>>a[i];

//    LL l=a[0];

//    rer(i,1,n-1)

//    {

//        LL t=__gcd(l,a[i]);

//        l=l/t*a[i];

//    }

//    LL sum=0;

//    l--;

//    rep(i,n)sum+=l%a[i];

//    cout<<sum<<endl;

    LL sum=0,x;

    while(n--)

    {

        cin>>x;

        sum+=x-1;

    }

    cout<<sum<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int n,a,sum=0;

	scanf("%d",&n);

	for(int i=0;i<n;i++)

	{

		scanf("%d",&a);

		sum+=a;

	}

	sum-=n;

	printf("%d\n",sum);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <stdio.h>

#include <stdlib.h>

#include <iostream>

#include <algorithm>

#include <string.h>

#include <sstream>

#include <stack>



using namespace std;



int main()

{

   int n;

   scanf("%d",&n);

   int *a=new int[n];

   for(int i=0;i<n;++i)

   {

       scanf("%d",&a[i]);

   }

   int sum=0;

   for(int i=0;i<n;++i)

   {

       sum+=a[i]-1;

   }

   printf("%d\n",sum);

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int n,a,sum=0;

	scanf("%d",&n);

	for(int i=0;i<n;i++)

	{

		scanf("%d",&a);

		sum+=a;

	}

	sum-=n;

	printf("%d\n",sum);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define dint __int128

#define ll long long

#define fup(i,a,b) for(int i=a;i<=b;++i)

#define upf(i,a,b) for(int i=a;i<b;++i)

#define fdn(i,a,b) for(int i=a;i>=b;++i)

#define dnf(i,a,b) for(int i=a;i>b;++i)

#define hh putchar(10)

#define kg putchar(32)

inline ll read(){ll x,f=1;char a;while((a=getchar())<48||a>57)if(a=='-')f=-1;

for(x=a^48;(a=getchar())>47&&a<58;x=(x<<3)+(x<<1)+(a^48));return f*x;}



void Main()

{

    int n;

    cin>>n;

    int a,ans=0;

    fup(i,1,n)cin>>a,ans+=(a-1);

    cout<<ans;

}

int main()

{

    Main();

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int t,b;

    int sum=0;

    scanf("%d",&t);

    while(t--)

    {

        scanf("%d",&b);

        sum=sum+b-1;

    }

    printf("%d\n",sum);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int n,tmp,ans;

int main(){

	cin>>n;

	while(n--){

		cin>>tmp;

		ans+=(tmp-1);

	}

	cout<<ans<<endl;

	return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int n,sum,i,b,a[200000];

	cin>>n;

	sum=0;

	for(i=0;i<n;i++)

	{

		scanf("%d",&b);

		sum+=b;

	}

	cout<<sum-n<<endl;

	return 0;

 } 

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>



using namespace __gnu_pbds;  

using namespace std;



typedef long long ll;



typedef tree<

pair <int, int>,

null_type,

less<pair <int, int>>,

rb_tree_tag,

tree_order_statistics_node_update>

os;



double getTime() {

  return clock() / (double) CLOCKS_PER_SEC;

}



void read() {};



template<typename T, typename... Args>

void read(T& a, Args&... args) {

  cin >> a;

  read(args...);

}



void print() {};



template <typename T, typename... Args>

void print(T a, Args... args) {

  cout << a << " \n"[sizeof...(args) == 0];

  print(args...);

}



int main() {

  int n; cin >> n;

  vector <int> a(n);

  for(auto &x : a) cin >> x;

  cout << accumulate(a.begin(), a.end(), 0) - n << '\n';

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
/*

        Author: Prokash

                CSE48, JU



*/



#include<bits/stdc++.h>

using namespace std;



typedef long long ll;

#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

int ara[2005];

int main()

{

    FAST;

    ll n;

    cin>>n;

    ll ans=0;

    while(n--)

    {

        int in;

        cin>>in;

        ans+=(in-1);//counting (lcm-1) sum;

    }

    cout<<ans<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,sum=0;

    cin>>n;

    int i,a[n];

    for(i=0;i<n;i++)

        cin>>a[i];

    for(i=0;i<n;i++)

        sum=sum+a[i];

        sum=sum-n;

    cout<<sum<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <stdio.h>

#include <iostream>

#include <algorithm>

#include <string>

#include <iomanip>

#include <math.h>

#include <utility>



#define div1 1000000007



using namespace std;



int main(void)

{

    long long N, X[100001], L[100001], i, S[100001], T[100001], ans=0, t=-10000000000;



    cin >> N;



    for(i=1; i<=N; i++){

        cin >> X[i] >> L[i];

        

        S[i] = X[i] - L[i];

        T[i] = X[i] + L[i];

    }



    pair<int, int> itv[100001];



    for(i=1; i<=N; i++){

        itv[i].first = T[i];//終

        itv[i].second = S[i];//始

    }



    sort(itv+1, itv+N+1);



    for(i=1; i<=N; i++){

        if(t <= itv[i].second){

            ans++;

            t = itv[i].first;

        }

    }



    cout << ans << endl;



    return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <iostream>

#include <algorithm>

#include <string>

#include <iomanip>

#include <math.h>

#include <utility>

#include <vector>

#include <map>

#include <unordered_map>

#include <cstdlib>

#include <stack>

#include <queue>

#define div1 1000000007

const long long INF = 1LL << 60;

using namespace std;

using ll = long long;

using ld = long double;

// a>b -> a==b;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

// a<b -> a==b;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }



int main(void)

{

    ll N, i, x, l, t, ans=0;

    

    cin >> N;



    vector<pair<ll,ll>> p(N);



    for(i=0; i<N; i++){

        cin >> x >> l;

        p[i].first = x+l; // 終

        p[i].second = x-l; // 始

    }



    sort(p.begin(), p.end());



    t = -10000000000;



    for(i=0; i<N; i++){

        if(t <= p[i].second){

            ans++;

            t = p[i].first;

        }

    }



    cout << ans << endl;



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)

typedef pair<int, int> P;



int n;

P robots[101010];



int main(){

  cin >> n;

  rep(i, n){

    int x, l;

    cin >> x >> l;

    robots[i].second = x - l;

    robots[i].first = x + l;

  }

  sort(robots, robots + n);

  //rep(i, n) cerr << robots[i].second << " " << robots[i].first << endl;

  int pos = -1000000000;

  int ans = 0;

  for(P x : robots){

    if(x.second >= pos){

      pos = x.first;

      ans++;

    }

  }

  cout << ans << endl;

  return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)

typedef long long int ll;

typedef pair<int, int> P;



int n;

P sec[101010];



int main()

{

    cin >> n;

    rep(i, n)

    {

        int x, l;

        cin >> x >> l;

        sec[i].first = x + l;

        sec[i].second = x - l;

    }

    sort(sec, sec + n);



    int res = 0, pos = -1000000001;

    rep(i, n)

    {

        if(pos <= sec[i].second)

        {

            pos = sec[i].first;

            res++;

        }

    }

    cout << res << endl;



    return 0;

}

// Fastest known solution for this problem: