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

using namespace std;



map<int,int> m;

vector<int> v;



int main(){

    int n,ans;

    cin>>n;

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

        int x;

        cin>>x;

        if(m[x]==0) v.push_back(x);

        ++m[x];

    }

    for(register int i=0;i<v.size();++i) if(m[v[i]]>=v[i]) ans+=m[v[i]]-v[i]; else ans+=m[v[i]];

    cout<<ans;

    return 0;

}

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

#define tin int

#define itn int

#define tni int

#define nit int

#define nti int

#define pritnf printf

#define scnaf scanf

#define retrun return

#define sizoef sizeof

#define ll long long

#define inl inline

#define br break

#define con continue

#define mst(a,b) memset(a,b,sizeof(a))

#define re register itn

#define fora(x,a,b) for(re x=a;x<=b;++x)

#define forb(x,a,b) for(re x=a;x>=b;--a)

#define infa 0x3f3f3f3f

#define infb 0x7fffffff

#define infc 1061109567

#define infd 0x7f

using namespace std;

#define maxa 100004

#define maxb 10004

#include<cstring>



tni num,x,n[maxa]={0},sum=0;



tin main()

{

	scanf("%d",&num);

	fora(i,1,num)

	{

		scanf("%d",&x);

		if(x>num)

		{

			++sum;

		}

		else

		{

			++n[x];

		}

	}

	//

	fora(i,1,num)

	{

		if(n[i]<i)

		{

			sum+=n[i];

		}

		else if(n[i]>i)

		{

			sum+=n[i]-i;

		}

	}

	//

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

	return 0;

}

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

using namespace std;

int main(){

  int n;

  cin >> n;

  int a;

  int i;

  int numbers[100001] = {};

  int wa = 0;

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

    a = 0;

    cin >> a;

    if(a>100000) wa++;

    else{

      numbers[a]++;

    }

  }

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

    if(numbers[i]<i) wa+=numbers[i];

    else wa+=numbers[i]-i;

  }

  cout << wa;



  

}

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

using namespace std;

int main(){

    int n;

    cin >> n;

    long a[n];

    int ans = 0;

    vector<int>num(n+1,0);

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

        cin >> a[i];

        if(a[i]<=n)num[a[i]]++;

        else ans++;

    }



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

        if(num[i]>=i)ans += num[i]-i;

        else ans += num[i];

    }

    cout << ans << endl;

}


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

#include<map>



using namespace std;



map<int, int> mp;



int n, cnt;



int main(void) {

	map<int, int> ::iterator i;

    int t;

    scanf("%d", &n);

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

        scanf("%d", &t);

        mp[t]++;

    }



    for (i = mp.begin(); i != mp.end(); i++) {

    	int a = (*i).first;

    	int b = (*i).second;

        if(b>=a) cnt += (b-a);

        else cnt += b;

	}

    printf("%d", cnt);



    return 0;

}

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

#include<algorithm>

using namespace std;

int n, a[100010];

int main(void) {

    int i, ncnt, cnt=0;

    scanf("%d", &n);

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

    sort(a, a+n);

    ncnt = 1;

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

        if(a[i]==a[i-1]) ncnt++;

        else {

            cnt += (ncnt>=a[i-1] ? ncnt-a[i-1] : ncnt);

            ncnt = 1;

        }

    }

    if(ncnt==1) {

        if(a[i-1]>ncnt) cnt++;

    }

    else {

        cnt += (ncnt>=a[i-1] ? ncnt-a[i-1] : ncnt);

    }



    printf("%d", cnt);



    return 0;

}

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

#include<map>

using namespace std;



map<int,int> d;



int b[100010],bl=0,ans;



int main(){

	int a,n; cin>>n;

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

		cin>>a; int ok=1;

		if(d[a]==0) b[bl++]=a,d[a]++;

		else d[a]++;

	}

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

		if(d[b[i]]>b[i]) ans+=d[b[i]]-b[i];

		else if(d[b[i]]<b[i]) ans+=d[b[i]];

	}

	cout<<ans<<endl;

	return 0;

} 

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

#include<algorithm>

using namespace std;

int inp[100000];

int main()

{

	int n,ans=0;

	scanf("%d",&n);

	for(int i=0;i<n;i++) scanf("%d",&inp[i]);

	sort(inp,inp+n);

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

	{

		cnt=1;

		while(inp[i]==inp[i+1])

		{

			cnt++;

			i++;

		}

		if(inp[i]<=cnt) ans+=cnt-inp[i];

		else ans+=cnt;

	}

	printf("%d",ans);

	return 0;

}

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

using namespace std;

int n,ans,s;

map<int,int> m;

vector<int> v;

int main()

{

	cin>>n;

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

		cin>>s;

		if(m[s]==0) v.push_back(s);

		m[s]++;

	}

	for(int i=0;i<v.size();i++) 

		if(m[v[i]]>=v[i]) ans+=m[v[i]]-v[i];

		else ans+=m[v[i]];

	cout<<ans<<endl;

	return 0;

}

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

#include<algorithm>

using namespace std;

int inp[100000];

int main()

{

	int n,ans=0;

	scanf("%d",&n);

	for(int i=0;i<n;i++) scanf("%d",&inp[i]);

	sort(inp,inp+n);

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

	{

		cnt=1;

		while(inp[i]==inp[i+1])

		{

			cnt++;

			i++;

		}

		if(inp[i]<=cnt) ans+=cnt-inp[i];

		else ans+=cnt;

	}

	printf("%d",ans);

	return 0;

}

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

using namespace std;



map<int,int> m;

vector<int> v;



int main(){

    int n,ans;

    cin>>n;

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

        int x;

        cin>>x;

        if(m[x]==0) v.push_back(x);

        ++m[x];

    }

    for(register int i=0;i<v.size();++i) if(m[v[i]]>=v[i]) ans+=m[v[i]]-v[i]; else ans+=m[v[i]];

    cout<<ans;

    return 0;

}

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

#include<algorithm>

using namespace std;

int inp[100000];

int main()

{

	int n,ans=0;

	scanf("%d",&n);

	for(int i=0;i<n;i++) scanf("%d",&inp[i]);

	sort(inp,inp+n);

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

	{

		cnt=1;

		while(inp[i]==inp[i+1])

		{

			cnt++;

			i++;

		}

		if(inp[i]<=cnt) ans+=cnt-inp[i];

		else ans+=cnt;

	}

	printf("%d",ans);

	return 0;

}

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

using namespace std;

map<int,int> m;

vector<int> v;

int main(){

    int n,ans;

    cin>>n;

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

    {

    int x;

    cin>>x;

    if(m[x]==0) v.push_back(x);

    ++m[x];

    }

    for(register int i=0;i<v.size();++i) if(m[v[i]]>=v[i]) ans+=m[v[i]]-v[i]; else ans+=m[v[i]];

    cout<<ans;

    return 0;

}

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

#include<algorithm>

using namespace std;

int inp[100000];

int main()

{

	int n,ans=0;

	scanf("%d",&n);

	for(int i=0;i<n;i++) scanf("%d",&inp[i]);

	sort(inp,inp+n);

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

	{

		cnt=1;

		while(inp[i]==inp[i+1])

		{

			cnt++;

			i++;

		}

		if(inp[i]<=cnt) ans+=cnt-inp[i];

		else ans+=cnt;

	}

	printf("%d",ans);

	return 0;

}

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

using namespace std;

int main()

{

	long long n,a[100010]={0},t=0,s;

	cin>>n;

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

		cin>>a[i];

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

	{

		if(a[i]!=0)

		{

		    s=0;

		    if(a[i]<=n)

			{

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

				{

					if(a[j]!=0&&a[j]==a[i]&&j!=i)

					{

						a[j]=0;

						s++;

					}

				}

				s++;

				if(s!=a[i])

				{

					if(s>a[i]) t+=s-a[i];

					else t+=s;

				}

			}

			else t++;

		}

	}

	cout<<t<<endl;

	return 0;

}

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

#define _inline __inline__ __attribute__((always_inline))

using namespace std;

_inline void read(int &x){

	int res=0,f=1;

	char c=getchar();

	if(c=='-') f=-1;

	while(c>'9'||c<'0') c=getchar();

	while(c>='0'&&c<='9'){

		res=res*10+c-'0';

		c=getchar();

	}

	x=res*f;

}

inline void print(int x){

    if(x<0) putchar('-'),x=-x;

    if(x>9) print(x/10);

    putchar(x%10+'0');

}

int n,a[100005],x,ans;

int main(){

    read(n);

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

        read(x);

        if(x>n) ans++;

        else a[x]++;

    }

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

        if(a[i]==0) continue;

        if(a[i]<i) ans+=a[i];

        else if(a[i]>i) ans+=a[i]-i;

    }

    print(ans),puts("");

    exit(0);

}

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

#include <cstdio>

#include <cmath>

#include <algorithm>

#include <numeric>

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

#define repr(i, m, n) for(int i = m;i >= n;i--)

#define SORT(v, n) sort(v, v+n);

#define INF 999999999

using namespace std;



int main(){

    int n; cin >> n;

    int rem = 0;

    int temp;

    int a[100001] = {0};

    rep(i, 1, n+1){

        cin >> temp;

        if(temp > 100000) rem += 1;

        else a[temp] += 1;

    }

//    cout << "a[0], a[1] =" << a[0] << " " << a[1] << endl;

    rep(i, 1, 100001){

        if(a[i] == 0) ;

        else if(a[i] < i) rem += a[i];

        else if(a[i] > i) rem += abs(i - a[i]);

    }



    cout << rem << endl;



    return 0;

}


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

using namespace std;



int main(){

    int n;

    cin >> n;

    vector<int> v(n+1);

    int ans = 0;

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

        int a;

        cin >> a;

        if(a > n) ans++;

        else v[a]++;

    }

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

        if(v[i] >= i) ans += v[i] - i;

        else ans += v[i];

    }

    cout << ans << endl;

    return 0;

}

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



using namespace std;



int a[100005];



int in()

{

    int a;

    scanf("%d",&a);

    return a;

}



int main()

{

    int n=in(),ans=0;

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

    {

        int aa=in();

        if(aa>100000)

            ans++;

        else

            a[aa]++;

    }

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

    {

        if(a[i]>i){

            ans+=(a[i]-i);

        }

        else if(a[i]<i)

        ans+=a[i];

    }

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

}

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

using namespace std;



#define DB	double

#define lf	else if

#define	I64	long long

#define Rd()	(rand() << 15 | rand())

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

#define Rep(i,a,b)	for(int i=a;i>=b;i--)

	

#define fi	first

#define se	second

#define MK	make_pair

#define PA	pair<int, int>



#define CH	(ch=getchar())

int		IN()	{

		int x= 0, f= 0, ch;

		for (; CH < '0' || ch > '9';)	f= (ch == '-');

		for (; ch >= '0' && ch <= '9'; CH)	(x*= 10)+= ch - '0';

		return	f ? -x : x;

}



#define n	200005



int		N, K, M, B[n];



map<int, int>	A;



bool	Cmp(int a, int b)	{

		return	A[a] < A[b];

}



int		main()	{

		N= IN();

		For(i, 1, N)	{

			int x= IN();

			A[x]++;

			

			if	(A[x] == 1)	B[++ M]= x;

		}

		

		int ans= 0;

		For(i, 1, M)	if	(A[B[i]] >= B[i])	ans+= A[B[i]] - B[i];

			else	ans+= A[B[i]];

		

		cout << ans;

}

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

using namespace std;

int xx[100005];

int main()

{

    int n,v,c=0;

    cin>>n;

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

    {

        cin>>v;

        if(v>100000)c++;

        else xx[v]++;

    }

    vector<int>vc,vc1;

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

    {

        if(xx[i]!=0)

        {

            if(xx[i]<i)c+=xx[i];

            else if(xx[i]>i)c+=xx[i]-i;

        }

    }

      cout<<c<<endl;



    return 0;

}


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

#include <map>

#include <vector>



#include <algorithm>



using namespace std;



int main()

{

    map<int,int> map_int_int; 

    int test;

    cin >> test;

    

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

    {

    	int bil;

    	cin>> bil;

    	if(!map_int_int[bil]) map_int_int[bil] = 1;

    	else map_int_int[bil]++;

	}

	

	int remove=0;

	for (map<int,int>::iterator it = map_int_int.begin() ; it != map_int_int.end() ; ++it) // mengiterasi semua isi dari map_int_string

    {

        pair<int,int> cur = *it;

//		cout << cur.first;

//		cout << "\n";

//		cout << cur.second;

		if(cur.second>cur.first) remove += cur.second - cur.first;

		else if (cur.second < cur.first) remove += cur.second;

    }

    

    cout << remove << "\n";

}

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

using namespace std;



int ar[100001];



int main()

{

    int N,temp;

    cin>>N;

    int cnt=0;

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

    {



        cin>>temp;

        if(temp>100000) cnt++;

        else ar[temp]++;

    }



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

    {

        if(ar[i]>=i) cnt+=(ar[i]-i);

        else cnt+=ar[i];

    }

    cout<<cnt<<endl;

}


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

using namespace std;

int main()

{

    int n;

    scanf("%d",&n);

    int arr[n+1],i;

    for(i=0; i<n; i++) scanf("%d",&arr[i]);

    sort(arr, arr+n);

    arr[n]=arr[n-1]+1;

    int ans=0,c=1;

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

    {

        if(arr[i]!=arr[i+1])

        {

            if(arr[i]<c) ans+=fabs(c-arr[i]);

            else if(arr[i]>c) ans+=c;

            //printf("%d %d\n",arr[i],c);

            c=1;

        }

        else c++;

    }

    //if(c>1) ans+=fabs(arr[i]-c);

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

    return 0;

}


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

using namespace std;

int main(void){

   long long int data[100002],cmp[100002];

   long long int a,n,count=0;

   cin >> n;

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

       cin >> a;

       if(a>100000){

           count++;

           

       }

       else{cmp[a-1]=a;

       data[a-1]+=1;

       }

   }

   for(long long int i=0;i<100000;i++){

        

       if(cmp[i]!=data[i]){

            

          for(int j=0;j<100000;j++){

              if(cmp[i]==data[i] || data[i]==0){

                  break;

              }

              data[i]--;

              count++;

          }

         

       }

       

   }

   cout << count << endl;

    return 0;

}


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



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

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

#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)

#define all(v) (v).begin(), (v).end()

#define pb(q) push_back(q)

#define P pair<int,int>

#define Abs(a,b) max(a,b)-min(a,b)

#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}

#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}

#define Cout(x) cout<<(x)<<endl



typedef long long ll;



using namespace std;







//while(x!=0){

            //sum+=x%10;

           // x/=10;

        //}

        //各桁の和



//pair<int,int> p[100000];

//P r[100000];

//cin >> tmp;

//p[i]=make_pair(tmp,i);

//cout << p[i].second+1 << endl;//ペアの右側つまりiを出力



//s.find(w[i])==string::npos

//findの使い方



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

   // b[i]=x%2;

    //x/=2;

  //}二進数



long long int n,cnt=0,ans=0,a[1000000],b,c,cmp[10000000],data,m,h,w,x,y,xcmp,ycmp,sum=0;

                                               //1000000000

string s;



vector<int> z;



int main(void){

       cin.tie(0);

    ios::sync_with_stdio(false);



       cin >> n;

       rep(i,n){

           cin >> a[i];

          // cmp[a[i]]++;

       }

       sort(a,a+n);

       rep(i,n){

           if(i==0){

               cmp[cnt]++;

           }

           if(a[i]!=a[i+1]){

               cnt++;

               cmp[cnt]++;

           }

           else{

               cmp[cnt]++;

           }

       }

       //Cout(cmp[0]);

       cnt=0;

       rep(i,n){

           if(a[i]!=cmp[cnt]){

               ans++;

               cmp[cnt]--;

           }

           if(a[i]!=a[i+1]){

               cnt++;

           }

       }

       Cout(ans);

return 0;

}


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

#include<iomanip>

#include<string.h>

using namespace std;

int main()

{

	int x,n=0;

	long long sum=2;

	cin>>x;

	do

	{

		sum=sum+1+(sum+1);

		n=n+1;

	}

	while(n<x);

	cout<<sum;

	return 0;

}

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

using namespace std;

long long n,f[200];  

int main()

{

  scanf("%lld",&n);f[0]=2;

  for(int i=1;i<=n;i++)  f[i]=f[i-1]*2+2;

  printf("%lld\n",f[n]);

  return 0;

}

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

using namespace std;

long long n;

long long srd[1000001]={2};

void dg(long long n){

	srd[n]=srd[n-1]*2+2;

	return;

}    

int main(){

	cin>>n;

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

		dg(i);

	cout<<srd[n];

	return 0;

}

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

long long f(int x){

    if(x==0){

        return 2;

    }else{

        return f(x-1)*2+2;

    }



}

int main(){

    int x;

    scanf("%d",&x);

    printf("%lld",f(x));

    return 0;

}

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

using namespace std;

int main()

{

    long long x,y=2;

    cin>>x;

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

    {

    y=2*y+2;

	}

    cout<<y<<endl;

    return 0;

}

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

long long f(int x){

    if(x==0){

        return 2;

    }else{

        return f(x-1)*2+2;

    }



}

int main(){

    int x;

    scanf("%d",&x);

    printf("%lld",f(x));

    return 0;

}

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

using namespace std;

long long n,ans=2;

int main()

{

   cin>>n;

   for(int i=1;i<=n;i++) ans=ans*2+2;

   cout<<ans<<"\n";

   return 0;

}

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

long long f(int x){

    if(x==0){

        return 2;

    }else{

        return f(x-1)*2+2;

    }



}

int main(){

    int x;

    scanf("%d",&x);

    printf("%lld",f(x));

    return 0;

}

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

using namespace std;

int main()

{

	int n;

	long long a[50];

	cin>>n;

	a[0]=2;

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

	{

		a[i]=2*a[i-1]+2;

	}

	cout<<a[n];

	return 0;

}

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

long long f(int x){

    if(x==0){

        return 2;

    }else{

        return f(x-1)*2+2;

    }



}

int main(){

    int x;

    scanf("%d",&x);

    printf("%lld",f(x));

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>//头文件不多说

using namespace std;

long long a,b=2;//一定要用long long,否则在#31-#41会WA

int main(){

    cin>>a;

    for(int i=0;i<a;i++)b=(b+1)*2;//乘法分配律

    cout<<b<<endl;

}

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

long long f(int x){

    if(x==0){

        return 2;

    }else{

        return f(x-1)*2+2;

    }



}

int main(){

    int x;

    scanf("%d",&x);

    printf("%lld",f(x));

    return 0;

}

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

using namespace std;

int n;

long long f[100];

int main()

{

    cin >> n;

    f[0] = 2;

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

    {

        f[i] = f[i-1]*2+2;

    }

    cout << f[n] << endl;

    return 0;

}

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

long long f(int x){

    if(x==0){

        return 2;

    }else{

        return f(x-1)*2+2;

    }



}

int main(){

    int x;

    scanf("%d",&x);

    printf("%lld",f(x));

    return 0;

}

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

using namespace std;

long long a[41];

int main()

{

	a[0]=2;

	int n;

	scanf("%d",&n);

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

	  a[i]=a[i-1]*2+2;

	printf("%lld\n",a[n]);

	return 0;

}

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

long long f(int x){

    if(x==0){

        return 2;

    }else{

        return f(x-1)*2+2;

    }



}

int main(){

    int x;

    scanf("%d",&x);

    printf("%lld",f(x));

    return 0;

}

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

#include<cstdio>

using namespace std;

long long f0=2,f1,t,n;

int main()

{

	cin>>n;

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

	{

		f1=f0*2+2;

		t=f0;

		f0=f1;

		f1=t;

	}

	cout<<f0<<'\n';

}

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



int main()

{

	long long n, x = 2, i;



	scanf("%lld", &n); 

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

		x = 2 * (x + 1);

	printf("%lld\n", x);



	return 0;

}

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

#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

#include<map>

#include<queue>

#include<cmath>

#include<stack>

#include<set>

#define ll long long

#define maxn 200005

#define re register

#define inf 1e9

#define eps 1e-10

using namespace std;



inline int read()

{

	int x=0,w=1; char c=getchar();

	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}

	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}

	return w==1?x:-x;

}



void write(int x)

{

	if(x>=10) write(x/10);

	putchar(x%10+'0');

}



ll f[45];



int main()

{

	int n; cin>>n;

	f[0]=2;

	for(int i=1;i<=n;i++) f[i]=f[i-1]*2+2;

	cout<<f[n];

	return 0;

}

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



int main()

{

	long long n, x = 2, i;



	scanf("%lld", &n); 

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

		x = 2 * (x + 1);

	printf("%lld\n", x);



	return 0;

}

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

#include<algorithm>

#include<string>

//#include<Hatsune_Miku>

using namespace std;

 long long f[420001]={2};

int n,ans=0;

int main()

{

	std::ios::sync_with_stdio(false);

	cin>>n;

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

	{

		f[i]=f[i-1]*2+2;

	}

	cout<<f[n]<<endl;

    return 0;

}

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



int main()

{

	long long n, x = 2, i;



	scanf("%lld", &n); 

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

		x = 2 * (x + 1);

	printf("%lld\n", x);



	return 0;

}

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

using namespace std;

long long n,f=2;

int main(void){

    scanf ("%lld",&n);

    while (n--)f=f*2+2;

    printf ("%lld\n",f);

}

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



int main()

{

	long long n, x = 2, i;



	scanf("%lld", &n); 

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

		x = 2 * (x + 1);

	printf("%lld\n", x);



	return 0;

}

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

using namespace std;

long long f[100];

int main()

{

	f[0]=2;

	int n;

	cin>>n;

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

		f[i]=f[i-1]*2+2;

	cout<<f[n]<<endl;

	return 0;

}

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



int main()

{

	long long n, x = 2, i;



	scanf("%lld", &n); 

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

		x = 2 * (x + 1);

	printf("%lld\n", x);



	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#pragma GCC optimize(2)

#include<bits/stdc++.h>

#define maxn 511

#define LL long long

#define maxm 10011

using namespace std;

typedef long long ll;

const LL inf=1e15;ll n;

ll work(ll x,ll i){

	if(i==n) return x;

	else {

		i++;

		return work(x*2+2,i);

	}

}

int main(){

	ll ans;

	cin>>n;

	ans=work(2,0);

	cout<<ans;

}


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



int main()

{

	long long n, x = 2, i;



	scanf("%lld", &n); 

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

		x = 2 * (x + 1);

	printf("%lld\n", x);



	return 0;

}

// Fastest known solution for this problem: