stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

struct Edge {

    int next, to;

} edge[200005 << 1];

int head[200005], n, ss, vis[200005], minn;



inline void add(int x, int y) {

    static int cnt = 1;

    edge[cnt].to = y, edge[cnt].next = head[x], head[x] = cnt++;

}



void DFS(int x, int s) {

    if (s > minn)minn = s, ss = x;

    for (int i = head[x]; i; i = edge[i].next) {

        if (vis[edge[i].to] == 0)vis[edge[i].to] = 1, DFS(edge[i].to, s + 1);

    }

}



queue<int> que;



int main() {

    cin >> n;

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

        cin >> x >> y;

        add(x, y), add(y, x);

    }

    DFS(1, 0), minn = 0, memset(vis, 0, sizeof(vis)), DFS(ss, 0);

    if ((minn + 1) % 3 == 2)cout << "Second";

    else cout << "First";

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8329259524937689x):
#include<bits/stdc++.h>

using namespace std;

const int maxn = 2e5 + 7;

int n;



int fir[maxn], nxt[2 * maxn], to[2 * maxn], e = 0;

void add(int x, int y) {

	to[++e] = y; nxt[e] = fir[x]; fir[x] = e;

	to[++e] = x; nxt[e] = fir[y]; fir[y] = e;

}



int dp[maxn];

int dfs(int pos, int f) {

	int y, z, rs = pos, d;

	for (y = fir[pos]; y; y = nxt[y]) {

		if((z = to[y]) == f) continue;

		dp[z] = dp[pos] + 1;

		d = dfs(z, pos);

		if(dp[d] > dp[rs]) rs = d;

	}

	return rs;

}



int main() {

	scanf("%d", &n);

	int x, y;

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

		scanf("%d%d", &x, &y);

		add(x, y);

	}

	dp[1] = 0;

	x = dfs(1, 0);

	dp[x] = 0;

	y = dfs(x, 0);

	//printf("%d %d\n", x, y);

	if(dp[y] % 3 == 1) printf("Second\n");

	else printf("First\n");

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

 

typedef long long LL;

typedef pair<int, int> PII;

typedef vector<int> VI;



#define MP make_pair

#define PB push_back

#define X first

#define Y second

 

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

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

#define ITER(it, a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)

#define ALL(a) a.begin(), a.end()

#define SZ(a) (int)((a).size())

#define FILL(a, value) memset(a, value, sizeof(a))

#define debug(a) cout << #a << " = " << a << endl;



const double PI = acos(-1.0);

const LL INF = 1e9 + 47;

const LL LINF = INF * INF;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());



const int N = 1 << 18;

int n;

VI g[N];

char used[N];

int d[N];



void bfs(int v)

{

	FILL(used, 0);

	used[v] = 1;

	d[v] = 0;

	queue<int> q;

	q.push(v);

	

	while(!q.empty())

	{

		v = q.front();

		q.pop();

		for(auto i: g[v])

			if (!used[i])

			{

				used[i] = 1;

				d[i] = d[v] + 1;

				q.push(i);

			}

	}

}



int main()

{

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

	//freopen("In.txt", "r", stdin);

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

	

	cin >> n;

	FOR(i, 0, n - 1)

	{

		int u, v;

		cin >> u >> v;

		g[u].PB(v);

		g[v].PB(u);

	}

	

	bfs(1);

	int mx = 1;

	FOR(i, 2, n + 1)

		if (d[i] > d[mx])

			mx = i;

	

	bfs(mx);

	mx = 1;

	FOR(i, 2, n + 1)

		if (d[i] > d[mx])

			mx = i;

	

	mx = d[mx];

//	debug(mx)

	if (mx % 3 == 1)

		cout << "Second" << endl;

	else

		cout << "First" << endl;

		

	cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 8.818581490802103x):
#include<bits/stdc++.h>

using namespace std;

const int maxn = 2e5 + 7;

int n;



int fir[maxn], nxt[2 * maxn], to[2 * maxn], e = 0;

void add(int x, int y) {

	to[++e] = y; nxt[e] = fir[x]; fir[x] = e;

	to[++e] = x; nxt[e] = fir[y]; fir[y] = e;

}



int dp[maxn];

int dfs(int pos, int f) {

	int y, z, rs = pos, d;

	for (y = fir[pos]; y; y = nxt[y]) {

		if((z = to[y]) == f) continue;

		dp[z] = dp[pos] + 1;

		d = dfs(z, pos);

		if(dp[d] > dp[rs]) rs = d;

	}

	return rs;

}



int main() {

	scanf("%d", &n);

	int x, y;

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

		scanf("%d%d", &x, &y);

		add(x, y);

	}

	dp[1] = 0;

	x = dfs(1, 0);

	dp[x] = 0;

	y = dfs(x, 0);

	//printf("%d %d\n", x, y);

	if(dp[y] % 3 == 1) printf("Second\n");

	else printf("First\n");

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;

vector<int> g[200001];

int mx  = 0 , vert = 1;

void dfs(int cur , int len = 0, int p = -1) {

    if(len > mx) {

        mx = len;

        vert = cur;

    }

    for(auto to : g[cur]) {

        if(to != p)

            dfs(to , len + 1 , cur);

    }

}



int main() {

    int n;

    cin >> n;

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

        int a , b;

        cin >> a >> b;

        g[a].push_back(b);

        g[b].push_back(a);

    }

    dfs(1);

    mx = 0;

    dfs(vert);

    if(mx % 3 == 1)

        cout << "Second";

    else

        cout << "First";

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 6.557662813749776x):
#include<bits/stdc++.h>

using namespace std;

const int maxn = 2e5 + 7;

int n;



int fir[maxn], nxt[2 * maxn], to[2 * maxn], e = 0;

void add(int x, int y) {

	to[++e] = y; nxt[e] = fir[x]; fir[x] = e;

	to[++e] = x; nxt[e] = fir[y]; fir[y] = e;

}



int dp[maxn];

int dfs(int pos, int f) {

	int y, z, rs = pos, d;

	for (y = fir[pos]; y; y = nxt[y]) {

		if((z = to[y]) == f) continue;

		dp[z] = dp[pos] + 1;

		d = dfs(z, pos);

		if(dp[d] > dp[rs]) rs = d;

	}

	return rs;

}



int main() {

	scanf("%d", &n);

	int x, y;

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

		scanf("%d%d", &x, &y);

		add(x, y);

	}

	dp[1] = 0;

	x = dfs(1, 0);

	dp[x] = 0;

	y = dfs(x, 0);

	//printf("%d %d\n", x, y);

	if(dp[y] % 3 == 1) printf("Second\n");

	else printf("First\n");

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define ll long long

const int maxx =  100005;

int a[maxx];

int main()

{

    int n;

    cin>>n;

    int flag = 0;

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

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

    }

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

        if(a[i] > a[i-1]){

            a[i]-=1;

        }

    }

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

        if(a[i] < a[i-1]){

            flag = 1;

        }

    }

    if(flag){

        cout<<"No"<<endl;

    }else{

        cout<<"Yes"<<endl;

    }

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.3227582604676x):
#include <cstdio>

int N;

int h[100005];

int main() {

    scanf("%d",&N);

    h[0] = 0;

    bool flag = true;

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

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

        if (!flag)

            continue;

        if (h[i] >= h[i-1] + 1)

            h[i]--;

        if (h[i] < h[i-1])

            flag = false;

    }

    if (flag)

        printf("Yes\n");

    else

        printf("No\n");

    return 0;

}
// Slower C++ solution:
#include <iostream>                           

using namespace std;                          

                                              

int main()                                    

{                                             

  int N;                                      

  cin >> N;                                   

  int h[N];                                   

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

    cin >> h[i];                              

  }                                           

  h[0]--;                                     

  bool flag = true;                           

  for (int i = 1; i < N && flag ; i++){       

    if (h[i] - h[i-1] < 0) flag = false;      

    else if (h[i] - h[i-1] == 0) h[i]++;      

    h[i]--;                                   

  }                                           

  if (flag) cout << "Yes" << endl;            

  else cout << "No" << endl;                  

}                                             

// Faster C++ solution for the same problem (measured speedup: 5.297954641483836x):
#include <cstdio>                          

using namespace std;                       

                                           

int main()                                 

{                                          

  int N;                                   

  scanf("%d", &N);                         

  int h[N];                                

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

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

  }                                        

  h[0]--;                                  

  bool flag = true;                        

  for (int i = 1; i < N && flag ; i++){    

    if (h[i] - h[i-1] < 0) flag = false;   

    else if (h[i] - h[i-1] == 0) h[i]++;   

    h[i]--;                                

  }                                        

  if (flag) printf("Yes\n");               

  else printf("No\n");                     

}
// Slower C++ solution:
#include<iostream>

using namespace std;

#define ll long long

int main(){

	ll n;

	cin>>n;

	ll a[100001]={0};

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

		cin>>a[i];

	}

	int f=1;

	for(int i=n-1;i>0;i--)

	{

		if(a[i]<a[i-1])

		{

			a[i-1]--;

			if(a[i]<a[i-1])

			{

				f=0;

				break;

			}

		}

	}

	if(f==1){

		cout<<"Yes"<<endl;

	}else{

		cout<<"No"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8116137751169692x):
#include <iostream>

#include <cstdio>

#include <cmath>

using namespace std;

int X[100005];

int Y[100005];

int N,A,B,C,m,n,a,b,c,x,y,z,i,j,k;

int main()

{

	cin>>N;

	for(i=N;i>=1;i--)

	{

		cin>>X[i];

	}

	for(j=1;j<=N;j++)

	{

		if(j==N)

		break;

		if(X[j]>=X[j+1])

		continue;

		else

		X[j+1]--;

		if(X[j]<X[j+1])

		{

			cout<<"No";

			return 0;

		}

	}

		cout<<"Yes";

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

#define ll long long

int main(){

	ll n;

	cin>>n;

	ll a[100001]={0};

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

		cin>>a[i];

	}

	int f=1;

	for(int i=n-1;i>0;i--)

	{

		if(a[i]<a[i-1])

		{

			a[i-1]--;

			if(a[i]<a[i-1])

			{

				f=0;

				break;

			}

		}

	}

	if(f==1){

		cout<<"Yes"<<endl;

	}else{

		cout<<"No"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8320849565164823x):
#include <bits/stdc++.h>



using namespace std;

typedef long long ll;







int n;

int a[100100];

int md[100100];

int main()

{

    scanf("%d", &n);

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

    {

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

    }

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

    {

        if (a[i] < a[i-1])

        {

            int j = i;

            while (j && a[j] < a[j-1] && md[j-1] < 2)

                --a[j-1],

                ++md[j-1],

                j--;

        }

    }

    bool bla = 1;

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

        if (a[i] > a[i+1] || md[i] > 1) bla = 0;

    if (bla)

        puts("Yes");

    else puts("No");



    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

#define ll long long

int main(){

	ll n;

	cin>>n;

	ll a[100001]={0};

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

		cin>>a[i];

	}

	int f=1;

	for(int i=n-1;i>0;i--)

	{

		if(a[i]<a[i-1])

		{

			a[i-1]--;

			if(a[i]<a[i-1])

			{

				f=0;

				break;

			}

		}

	}

	if(f==1){

		cout<<"Yes"<<endl;

	}else{

		cout<<"No"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.7825456022155517x):
#include <bits/stdc++.h>

#define sz(v)   ((int)(v).size())

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

#define  allr(v)    ((v).rbegin()),((v).rend())

#define   pb         push_back

#define   mp         make_pair

#define    clr(v,d)      memset( v, d ,sizeof(v))

typedef  long long     ll ;

using namespace std;

void GO(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

const int N=100009;

int a[N];

int main(){

    GO();

    int n;

    cin>>n;

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

        cin>>a[i];

    }

    int mx=a[0];

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

        if(a[i]>a[i-1]){

            mx=max(mx,a[i]);

        }

        else if(mx-a[i]>1){

            cout<<"No"<<endl;

            return 0;

        }

    }

    cout<<"Yes"<<endl;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

#define ll long long

int main(){

	ll n;

	cin>>n;

	ll a[100001]={0};

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

		cin>>a[i];

	}

	int f=1;

	for(int i=n-1;i>0;i--)

	{

		if(a[i]<a[i-1])

		{

			a[i-1]--;

			if(a[i]<a[i-1])

			{

				f=0;

				break;

			}

		}

	}

	if(f==1){

		cout<<"Yes"<<endl;

	}else{

		cout<<"No"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8109878230682266x):
#include <bits/stdc++.h>



using namespace std;

const int N = 1e5+5;

bool dp[N][2];

int v[N];

int main()

{

    int n;

    cin >> n;

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

        cin >> v[i];

    dp[1][0] = dp[1][1] = 1;

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

    {

        if (v[i]>=v[i-1])

            dp[i][0]|=dp[i-1][0];

        if (v[i]>=v[i-1]-1)

            dp[i][0]|=dp[i-1][1];

        if (v[i]-1>=v[i-1])

            dp[i][1]|=dp[i-1][0];

        if (v[i]-1>=v[i-1]-1)

            dp[i][1]|=dp[i-1][1];

    }

    if (dp[n][0] || dp[n][1])

        cout << "Yes";

    else

        cout << "No";

}
// Slower C++ solution:
#include<iostream>

using namespace std;

#define ll long long

int main(){

	ll n;

	cin>>n;

	ll a[100001]={0};

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

		cin>>a[i];

	}

	int f=1;

	for(int i=n-1;i>0;i--)

	{

		if(a[i]<a[i-1])

		{

			a[i-1]--;

			if(a[i]<a[i-1])

			{

				f=0;

				break;

			}

		}

	}

	if(f==1){

		cout<<"Yes"<<endl;

	}else{

		cout<<"No"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.785794376687698x):
#include "bits/stdc++.h"

#include "sstream"

#define quick ios_base::sync_with_stdio(false);cin.tie(NULL);

using namespace std;

const int N=1e5+1;

 int arr[N];

int main() {

    quick

int n; cin>>n;

for(int i=0;i<n;i++){cin>>arr[i];}

for(int i=n-1;i>0;i--){

if(arr[i]<arr[i-1]){ arr[i-1]--;}

}

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

        if(arr[i-1] > arr[i])

            return cout <<"No", 0;



    cout<<"Yes";

}
// Slower C++ solution:
#include<iostream>

using namespace std;

#define ll long long

int main(){

	ll n;

	cin>>n;

	ll a[100001]={0};

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

		cin>>a[i];

	}

	int f=1;

	for(int i=n-1;i>0;i--)

	{

		if(a[i]<a[i-1])

		{

			a[i-1]--;

			if(a[i]<a[i-1])

			{

				f=0;

				break;

			}

		}

	}

	if(f==1){

		cout<<"Yes"<<endl;

	}else{

		cout<<"No"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.7921436899482504x):
#include <iostream>

#include <bits/stdc++.h>

using namespace std;



#define pb push_back

#define F first

#define S second

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



using ll = long long;

using ld = long double;

using ul = unsigned long long;

using ii = pair<int, int>;

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

#define ReadFile            freopen("input.in","r",stdin)

#define WriteFile           freopen("output.txt","w",stdout)

const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f;

const ld EPS = 1e-7;

double Pi=acos(-1);

const ld rad=Pi/180.0;

ll power(ll x, ll y, ll p)

{

    ll res = 1;

    while (y > 0)

    {

        if (y & 1)

            res = (res*x) % p;

        y = y>>1;

        x = (x*x) % p;

    }

    return res;

}

ll nCr (ll n,ll m)

{

        return(m == 0)?1:n*nCr(n-1,m-1)/m;

}

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





int main()

{

    int n;

    cin >> n;

    vector <int> vec(n);

    vector <int> vec2(n);

    vector <int> vec3(n);

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

        cin >> vec[i];

    vec2 = vec;



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



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

        vec3[i] = abs(vec2[i] - vec[i]);



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

        if(vec3[i] > 1){

            cout << "No\n";

            return 0;

        }

    }



    cout << "Yes\n";



    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

#define ll long long

int main(){

	ll n;

	cin>>n;

	ll a[100001]={0};

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

		cin>>a[i];

	}

	int f=1;

	for(int i=n-1;i>0;i--)

	{

		if(a[i]<a[i-1])

		{

			a[i-1]--;

			if(a[i]<a[i-1])

			{

				f=0;

				break;

			}

		}

	}

	if(f==1){

		cout<<"Yes"<<endl;

	}else{

		cout<<"No"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.832546448301187x):
#include <bits/stdc++.h>

using namespace std;

const int N=1e5+5;

int A[N],n,mx,mn;

int main(){

    scanf("%d",&n);

    scanf("%d",A+0);

    mx=A[0];

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

        scanf("%d",A+i);

        if(A[i]<mx-1){

            puts("No");

            return 0;

        }

        mx=max(A[i],mx);

    }

    puts("Yes");

    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

#define ll long long

int main(){

	ll n;

	cin>>n;

	ll a[100001]={0};

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

		cin>>a[i];

	}

	int f=1;

	for(int i=n-1;i>0;i--)

	{

		if(a[i]<a[i-1])

		{

			a[i-1]--;

			if(a[i]<a[i-1])

			{

				f=0;

				break;

			}

		}

	}

	if(f==1){

		cout<<"Yes"<<endl;

	}else{

		cout<<"No"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8069119417088921x):
#include <bits/stdc++.h>

using namespace std;

int main(){

  int N,i;cin>>N;int H[N];

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

  for(i=N-1;i>0;i--){

    if(H[i-1]>H[i]){

      if(H[i-1]-H[i]==1)H[i-1]--;

      else break;

    }

  }

  if(i==0)cout<<"Yes"<<endl;

  else cout<<"No"<<endl;

}
// Slower C++ solution:
// #include<stdio.h>

#include<iostream>

#include<string.h>

using namespace std;

int main(void) {

	int j = 0;

    string s,t;

//	char s[200000], t[200000];

	// scanf("%s", &s);

	// scanf("%s", &t);

    cin >> s >> t;



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

		if (s[i] != t[i]){

			j++;

        }

    }



	// printf("%d", j);

    cout << j << endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.116675689535224x):
#include<stdio.h>

#include<string.h>



int main(void) {

	int j = 0;

	char s[200001], t[200001];

	scanf("%s%s",&s, &t);



	for (int i = 0; i <= strlen(s); i++)

		if (s[i] != t[i])

			j++;

	printf("%d", j);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

using namespace std;



typedef long long ll;

const int N = 2e5 + 10, OO = 0x3f3f3f3f, mod = 1e9 + 7;



#define PI acos(-1)

#define clr(arr, val) memset(arr, val, sizeof(arr))

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

#define rloop(i, n) for (int i = int(n) - 1; i >= 0; i--)

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

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

#define SZ(v) ((int)((v).size()))

//int dx[] = {1, 0, -1, 0};

//int dy[] = {0, 1, 0, -1}; //4 Direction

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};

int dy[] = {0, 1, 1, 1, 0, -1, -1, -1}; //8 direction

//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction

//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction



int n , dp[N];

string s , t;



int solve(int idx){

  if(idx == n)

    return 0;

  int &ret = dp[idx];

  if(~ret) return ret;

  if(s[idx] == t[idx])

    return ret = solve(idx+1);

  ret = OO;

  return ret = min(ret , solve(idx+1)+1);



}



int main()

{

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



  cin >> s >> t;

  n = SZ(s);

  memset(dp , -1 , sizeof dp);

  printf("%d\n" , solve(0));



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.801162243940577x):
#include <bits/stdc++.h>

using namespace std;

/*  Writen by : AS7

 *  "JUST KEEP GOING..."

 */

#define endl			'\n'

#define ll				long long

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

#define allr(v)			((v).rbegin()), ((v).rend())

#define sz(v)			((int)((v).size()))

#define clr(v, d)		memset(v, d, sizeof(v))

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

#define For(i,s)        for(auto i:s)

#define Forr(i,s)        for(auto &i:s)

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

#define lpi(i, j, n)	for(int i=(j);i<(int)(n);++i)

#define lpd(i, j, n)	for(int i=(j);i>=(int)(n);--i)

#define vi				vector <int>

#define vl				vector <ll>

#define ii				pair <int,int>

#define vii				vector <ii>

#define vll				vector <pair<ll,ll>>

#define PI				double PPPPPP = 3.14159265358979323846;

#define bit(mask,i) ((mask>>i)&1)

const int N = 2e5+5;

map<int ,bool> vis;

int ans;

void solve(){

   string s,t;

   cin>>s>>t;

   rep(i,s){

       ans+=(s[i]!=t[i]);

   }

   cout<<ans<<endl;

}

int main() {

    int t = 1;

   //cin>>t;

    while (t--)solve();

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

using namespace std;



typedef long long ll;

const int N = 2e5 + 10, OO = 0x3f3f3f3f, mod = 1e9 + 7;



#define PI acos(-1)

#define clr(arr, val) memset(arr, val, sizeof(arr))

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

#define rloop(i, n) for (int i = int(n) - 1; i >= 0; i--)

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

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

#define SZ(v) ((int)((v).size()))

//int dx[] = {1, 0, -1, 0};

//int dy[] = {0, 1, 0, -1}; //4 Direction

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};

int dy[] = {0, 1, 1, 1, 0, -1, -1, -1}; //8 direction

//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction

//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction



int n , dp[N];

string s , t;



int solve(int idx){

  if(idx == n)

    return 0;

  int &ret = dp[idx];

  if(~ret) return ret;

  if(s[idx] == t[idx])

    return ret = solve(idx+1);

  ret = OO;

  return ret = min(ret , solve(idx+1)+1);



}



int main()

{

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



  cin >> s >> t;

  n = SZ(s);

  memset(dp , -1 , sizeof dp);

  printf("%d\n" , solve(0));



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7885913581944393x):
#include<iostream>

#include<string>

#include<cstring>

#include<string.h>

#include <bits/stdc++.h>

using namespace std;

int main(){

long long sum=0;

string s;cin>>s;

string x;cin>>x;

if(x==s){

	cout<<0;

}

else{

for(long long i=0;i<s.size();i++){

	if(s[i]!=x[i]){

		sum++;

	}

}

cout<<sum;

}

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

using namespace std;



typedef long long ll;

const int N = 2e5 + 10, OO = 0x3f3f3f3f, mod = 1e9 + 7;



#define PI acos(-1)

#define clr(arr, val) memset(arr, val, sizeof(arr))

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

#define rloop(i, n) for (int i = int(n) - 1; i >= 0; i--)

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

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

#define SZ(v) ((int)((v).size()))

//int dx[] = {1, 0, -1, 0};

//int dy[] = {0, 1, 0, -1}; //4 Direction

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};

int dy[] = {0, 1, 1, 1, 0, -1, -1, -1}; //8 direction

//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction

//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction



int n , dp[N];

string s , t;



int solve(int idx){

  if(idx == n)

    return 0;

  int &ret = dp[idx];

  if(~ret) return ret;

  if(s[idx] == t[idx])

    return ret = solve(idx+1);

  ret = OO;

  return ret = min(ret , solve(idx+1)+1);



}



int main()

{

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



  cin >> s >> t;

  n = SZ(s);

  memset(dp , -1 , sizeof dp);

  printf("%d\n" , solve(0));



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7880177468737226x):
#include<iostream>

using namespace std;

int main()

{

    string S,T;

    cin>>S>>T;

    int count=0;

    for(int i=0;i<S.length();i++){

        if(S[i]!=T[i]){

            count++;

        }

    }

    cout<<count;

    return 0;

}