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

using namespace std;



int main () {

  int a, b;

  scanf("%d %d", &a, &b);

  if (a*b % 2 == 0) printf("Even\n");

  else printf("Odd\n");

  return 0;

}

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

int main()

{

    int a,b;

    scanf("%d%d",&a,&b);

    if((a*b)%2==0)printf("Even\n");

    else

        printf("Odd\n");

}

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

namespace chtholly{

typedef long long ll;

#define re0 register int

#define rec register char

#define rel register ll

#define gc getchar

#define pc putchar

#define p32 pc(' ')

#define pl puts("")

/*By Citrus*/

inline int read(){

  re0 x=0,f=1;rec c=gc();

  for (;!isdigit(c);c=gc()) f^=c=='-';

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return f?x:-x;

  }

inline void read(rel &x){

  x=0;re0 f=1;rec c=gc();

  for (;!isdigit(c);c=gc()) f^=c=='-';

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  x=f?x:-x;

  }

template <typename mitsuha>

inline int write(mitsuha x){

  if (!x) return pc(48);

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

  re0 bit[20],i,p=0;

  for (;x;x/=10) bit[++p]=x%10;

  for (i=p;i;--i) pc(bit[i]+48);

  }

inline char fuhao(){

  rec c=gc();

  for (;isspace(c);c=gc());

  return c;

  }

}using namespace chtholly;

using namespace std;



int main(){

puts(read()*read()&1?"Odd":"Even");

}

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

int main()

{

    int a,b;

    scanf("%d%d",&a,&b);

    if((a*b)%2==0)printf("Even\n");

    else

        printf("Odd\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// CodeForces - 1A

#include<bits/stdc++.h>

using namespace std;



int main(){

    ios_base::sync_with_stdio(false);

    int a, b;

    cin >> a >> b;

    

    if((a % 2 == 0) || (b % 2 == 0))    cout << "Even";

    else    cout << "Odd";

    

    return 0;

}

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

int main()

{

    int a,b;

    scanf("%d%d",&a,&b);

    if((a*b)%2==0)printf("Even\n");

    else

        printf("Odd\n");

}

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

#include <cstring>

#include <cstdlib>

#include <algorithm>

#include <utility>

#include <vector>

#include <tuple>

#include <cmath>



using namespace std;



int main() {

  int a, b, c;



  #ifdef DEBUG

  freopen("5-08-a.txt", "r", stdin);

  #endif



  while (cin >> a >> b) {

    c = a * b;

    cout << (c % 2 == 0 ? "Even" : "Odd") << endl;

  }



  return 0;

}


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

int main()

{

    int a,b;

    scanf("%d%d",&a,&b);

    if((a*b)%2==0)printf("Even\n");

    else

        printf("Odd\n");

}

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

using namespace std;

int main(){

	int a,b;

	while(cin>>a>>b){

		if((a*b)%2==0)

		cout<<"Even"<<endl;

		else

		cout<<"Odd"<<endl;

	}

	return 0;

}

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

int main()

{

    int a,b;

    scanf("%d%d",&a,&b);

    if((a*b)%2==0)printf("Even\n");

    else

        printf("Odd\n");

}

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

#include <iostream>

#include <vector>

#include <map>

#include <set>

#include <list>

#include <cmath>

#include <cstring>

#include <algorithm>

using namespace std;

/*#define fast ios_base::sync_with_stdio(0); cin.tie(0)*/

#define ff first

#define ss second

#define pb push_back

#define mp make_pair

const double pi = acos(-1);

typedef long long ll;

int main()

{

	//fast;

	

	ll a,b,c,x;

	cin>>a>>b;

	((a*b)%2)?cout<<"Odd":cout<<"Even";

}

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

int main()

{

    int a,b;

    scanf("%d%d",&a,&b);

    if((a*b)%2==0)printf("Even\n");

    else

        printf("Odd\n");

}

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

using namespace std;

#define  ll long long int

main()

{

    ll a,b;

    cin>>a>>b;

    if((a*b)%2==0)

        cout<<"Even"<<endl;

    else

        cout<<"Odd"<<endl;

}


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

int main()

{

    int a,b;

    scanf("%d%d",&a,&b);

    if((a*b)%2==0)printf("Even\n");

    else

        printf("Odd\n");

}

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

using namespace std;

typedef long long ll;



const ll MOD = 1e9+7;



const int MAX=100010;



vector<ll> fac(MAX), finv(MAX), inv(MAX);



void cmbInit() {

    fac[0]=fac[1]=1;

    finv[0]=finv[1]=1;

    inv[1]=1;

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

        fac[i]=(fac[i-1]*i)%MOD;

        inv[i]=MOD-(inv[MOD%i]*(MOD/i))%MOD;

        finv[i]=(finv[i-1]*inv[i])%MOD;

    }

}



int main() {

    int n;

    cin >> n;

    vector<ll> x(n);

    ll xin,oxin;

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

        cin >> xin;

        if (i>0) x[i]=xin-oxin;

        oxin = xin;

    }

    vector<ll> p(n), sump(n);

    cmbInit();

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

        p[i]=(fac[n-1]*inv[i])%MOD;

        if (i==1) sump[i]=p[i];

        else sump[i]=(p[i]+sump[i-1])%MOD;

    }

    

    ll ans=0;

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

        ans+=(x[i]*sump[i])%MOD;

        ans=ans%MOD;

    }

    cout << ans << endl;

}

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

typedef long long ll;

using namespace std;

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

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

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

#define invrep(i,n) invrepr(i,0,n)

#define repitr(itr,a) for(auto itr=a.begin();itr!=a.end();++itr)

#define P pair<int,int>

const ll MOD=1e9+7;

const ll INF=1e9;

const double PI=acos(-1);

const int MAX=100010;



ll fac[MAX], finv[MAX], inv[MAX];



void cmbInit() {

    fac[0]=fac[1]=1;

    finv[0]=finv[1]=1;

    inv[1]=1;

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

        fac[i]=fac[i-1]*i%MOD;

        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;

        finv[i]=finv[i-1]*inv[i]%MOD;

    }

}





ll cmb(int n, int k){

    if (n<k) return 0;

    if (n<0 || k<0) return 0;

    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;

}





int main() {

    ios_base::sync_with_stdio(false); 



    int n;

    cin >> n;

    vector<ll> x(n),p(n);

    rep(i,n) cin >> x[i];

    cmbInit();

    rep(i,n-1) p[i+1]=((fac[n-1]*inv[i+1])%MOD+p[i])%MOD;

    ll ans=0;

    rep(i,n-1) ans=(ans+((x[i+1]-x[i])*p[i+1])%MOD)%MOD;

    cout << ans << endl;



    return 0;

}


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



using namespace std;

const int mod = 1e9 + 7;

int qs[(int)1e5 + 5], inv[(int)1e5 + 5];

int pow(int val, int idx){

    if(idx == 0) return 1;

    if(idx == 1) return val;

    int k = pow(val, idx >> 1);

    k = (1LL * k * k) %  mod;

    if(idx & 1) k = (1LL * k * val) % mod;

    return k;

}

int main(){

    int n, pre, x;

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

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

        scanf("%d", &x);

        qs[i] = qs[i-1] + x - pre;

        pre = x;

    }

    int fac = 1;

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

        fac = (1LL * fac * i) % mod;

        inv[i] = i == 1 ? 1 : pow(i, mod - 2);

    }

    int ans = 0;

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

        ans += (1LL * (qs[n - 1] - qs[i-1]) * (1LL * fac * inv[i] % mod)) % mod;

        ans = ans >= mod ? ans - mod : ans;

    }

    printf("%d",ans);







}


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



using namespace std;

const int mod = 1e9 + 7;

int qs[(int)1e5 + 5], inv[(int)1e5 + 5];

int pow(int val, int idx){

    if(idx == 0) return 1;

    if(idx == 1) return val;

    int k = pow(val, idx >> 1);

    k = (1LL * k * k) %  mod;

    if(idx & 1) k = (1LL * k * val) % mod;

    return k;

}

int main(){

    int n, pre, x;

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

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

        scanf("%d", &x);

        qs[i] = qs[i-1] + x - pre;

        pre = x;

    }

    int fac = 1;

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

        fac = (1LL * fac * i) % mod;

        inv[i] = i == 1 ? 1 : pow(i, mod - 2);

    }

    int ans = 0;

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

        ans += (1LL * (qs[n - 1] - qs[i-1]) * (1LL * fac * inv[i] % mod)) % mod;

        ans = ans >= mod ? ans - mod : ans;

    }

    printf("%d",ans);







}


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

using namespace std;

const double EPS = 1E-9;

const long long INF = 1000LL * 1000 * 1000 * 1000 * 1000 * 1000;

#define pb push_back

#define ll long long

int n;

int a[100000] , b[100000];

map<int , int> g;

int main()

{

	scanf("%d" , &n);

	ll ans = 0;

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

	{

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

		g[a[i]] = i % 2;

		b[i] = a[i];

	}

	sort(b , b + n);

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

	{

		if(g[b[i]] != i % 2)

		{

			ans++;

		}

	}

	cout << ans / 2;

}


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

#include<algorithm>

using namespace std;

const int maxn = 100000;

int num[maxn + 10];

int ji[maxn + 10];

int ou[maxn + 10];

int n;

int main()

{

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

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

	scanf("%d",&n);

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

	{

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

		if(i & 1)

		{

			ji[(i + 1) / 2] = num[i];

		}

		else

		{

			ou[i / 2] = num[i];

		}

	}

	sort(ji + 1,ji + 1 + (n + 1) / 2);

	sort(ou + 1,ou + 1 + n / 2);

	sort(num + 1,num + 1 + n);

	int ans = 0;

	if(n & 1)

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < (n + 1) / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < (n + 1) / 2)

				++p;

		}

	}

	else

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < n  / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < n  / 2)

				++p;

		}

	}

	printf("%d",ans);

	return 0;

}

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

#include <istream>

#include <cstdio>

#include <vector>

#include <cmath>

#include <algorithm>

#include <map>

#include <set>

//#include <unordered_map>

#include <cstring>

#include <string.h>

#include <iomanip>

#include <queue>

#include <stack>

#include <list>

#include <sstream>

//#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef unsigned long long ull;

typedef pair<int,int> ii;

typedef vector<int> vi;

typedef long double ld;



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

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

#define pb push_back

#define mp make_pair

#define f first

#define s second



#define fopen freopen("substrcmp.in", "r", stdin); freopen("substrcmp.out","w", stdout)

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

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

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

#define IOSFAST ios::sync_with_stdio(false); cin.tie(0)



const ll MOD = 1000LL * 1000 * 1000 + 7;

const int INF = 1e9;

const ll base = 1e18;

const int MAX = 1000;

const double EPS = 1e-9;

const double PI = acos(-1.);



int n;

pair<int,int> a[200000];

int main()

{

	IOSFAST;

	cin >> n;

	FOR(i,0,n)

	{

		cin >> a[i].f;

		a[i].s = i;

	}

	sort(a,a+n);

	int res = 0;

	FOR(i,0,n)

	{

		if (abs(a[i].s-i)%2)

		{

			res++;

		}

	}

	cout << res/2;

	return 0;

}


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

#include<algorithm>

using namespace std;

const int maxn = 100000;

int num[maxn + 10];

int ji[maxn + 10];

int ou[maxn + 10];

int n;

int main()

{

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

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

	scanf("%d",&n);

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

	{

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

		if(i & 1)

		{

			ji[(i + 1) / 2] = num[i];

		}

		else

		{

			ou[i / 2] = num[i];

		}

	}

	sort(ji + 1,ji + 1 + (n + 1) / 2);

	sort(ou + 1,ou + 1 + n / 2);

	sort(num + 1,num + 1 + n);

	int ans = 0;

	if(n & 1)

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < (n + 1) / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < (n + 1) / 2)

				++p;

		}

	}

	else

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < n  / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < n  / 2)

				++p;

		}

	}

	printf("%d",ans);

	return 0;

}

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

#include <ext/algorithm>

#include <ext/numeric>



using namespace std;

using namespace __gnu_cxx;



int main()

{

	ios_base::sync_with_stdio(0);

	cin.tie(0);



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



	int N;

	cin >> N;

	pair<int,int> array[N];



	int count;

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

	{

		cin >> count;

		array[i] = {count,i};

	}



	sort(array, array+N);

	count = 0;

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

		if(i%2 != array[i].second%2)

			count++;



	cout << count/2 << endl;

}

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

#include<algorithm>

using namespace std;

const int maxn = 100000;

int num[maxn + 10];

int ji[maxn + 10];

int ou[maxn + 10];

int n;

int main()

{

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

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

	scanf("%d",&n);

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

	{

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

		if(i & 1)

		{

			ji[(i + 1) / 2] = num[i];

		}

		else

		{

			ou[i / 2] = num[i];

		}

	}

	sort(ji + 1,ji + 1 + (n + 1) / 2);

	sort(ou + 1,ou + 1 + n / 2);

	sort(num + 1,num + 1 + n);

	int ans = 0;

	if(n & 1)

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < (n + 1) / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < (n + 1) / 2)

				++p;

		}

	}

	else

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < n  / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < n  / 2)

				++p;

		}

	}

	printf("%d",ans);

	return 0;

}

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



using namespace std;



pair<int, int> A[100010];



int main(){



	ios::sync_with_stdio(0);

	cin.tie(0);



	int n, input;

	cin >> n;

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

		cin >> input;

		A[i] = make_pair(input, i);

	}

	sort(A, A+n);



	int counter = 0;

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

		if((A[i].second-i)&1) 

			counter++;

	

	cout << counter/2 << '\n';

	

	return 0;

} // br1


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

#include<algorithm>

using namespace std;

const int maxn = 100000;

int num[maxn + 10];

int ji[maxn + 10];

int ou[maxn + 10];

int n;

int main()

{

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

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

	scanf("%d",&n);

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

	{

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

		if(i & 1)

		{

			ji[(i + 1) / 2] = num[i];

		}

		else

		{

			ou[i / 2] = num[i];

		}

	}

	sort(ji + 1,ji + 1 + (n + 1) / 2);

	sort(ou + 1,ou + 1 + n / 2);

	sort(num + 1,num + 1 + n);

	int ans = 0;

	if(n & 1)

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < (n + 1) / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < (n + 1) / 2)

				++p;

		}

	}

	else

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < n  / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < n  / 2)

				++p;

		}

	}

	printf("%d",ans);

	return 0;

}

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

#include <iostream>

#include <cstring>

#include <vector>

#include <cstdio>

#include <stack>

#include <queue>

#include <cmath>

#include <map>

#include <set>

#define F first

#define S second

#define PII pair<int, int>

typedef long long LL;





using namespace std;



const int N = 1e5 + 10;

const LL INF = 1e16;

vector<LL> v;

LL n, a[N], r[N], ans;

map<int, bool> mp;



int main() {

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

  cin >> n;

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

    cin >> a[i];

    if (i % 2)

      mp[a[i]] = true;

    r[i] = a[i];

  }

  sort(r, r + n);

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

    if (i % 2 && !mp[r[i]])

      ans++;

  }

  cout << ans;

  return 0;

}


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

#include<algorithm>

using namespace std;

const int maxn = 100000;

int num[maxn + 10];

int ji[maxn + 10];

int ou[maxn + 10];

int n;

int main()

{

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

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

	scanf("%d",&n);

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

	{

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

		if(i & 1)

		{

			ji[(i + 1) / 2] = num[i];

		}

		else

		{

			ou[i / 2] = num[i];

		}

	}

	sort(ji + 1,ji + 1 + (n + 1) / 2);

	sort(ou + 1,ou + 1 + n / 2);

	sort(num + 1,num + 1 + n);

	int ans = 0;

	if(n & 1)

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < (n + 1) / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < (n + 1) / 2)

				++p;

		}

	}

	else

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < n  / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < n  / 2)

				++p;

		}

	}

	printf("%d",ans);

	return 0;

}

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



using namespace std;



const int N = 1e5 + 100;



typedef pair<int,int> pii;



pii a[N];

int n, cnt;



int main(){

	cin >> n;

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

		int x;

		cin >> x;

		a[i] = pii(x, i);

	}

	sort(a, a + n);

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

		if (i % 2 != a[i].second % 2)

			cnt++; 	

	}

	return cout << cnt / 2, 0;

}


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

#include<algorithm>

using namespace std;

const int maxn = 100000;

int num[maxn + 10];

int ji[maxn + 10];

int ou[maxn + 10];

int n;

int main()

{

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

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

	scanf("%d",&n);

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

	{

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

		if(i & 1)

		{

			ji[(i + 1) / 2] = num[i];

		}

		else

		{

			ou[i / 2] = num[i];

		}

	}

	sort(ji + 1,ji + 1 + (n + 1) / 2);

	sort(ou + 1,ou + 1 + n / 2);

	sort(num + 1,num + 1 + n);

	int ans = 0;

	if(n & 1)

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < (n + 1) / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < (n + 1) / 2)

				++p;

		}

	}

	else

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < n  / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < n  / 2)

				++p;

		}

	}

	printf("%d",ans);

	return 0;

}

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

#include <cstdlib>

#include <cstdio>

#include <algorithm>

#include <vector>

using namespace std;

inline void _read(int &x)

{

	x = 0;

	char t = getchar();

	while (!isdigit(t)) t = getchar();

	while (isdigit(t))

	{

		x = x * 10 + t - '0';

		t = getchar();

	}

}

 

const int MAXN = 1e5 + 10;

int n, ans;

pair <int, int> in[MAXN];

 

int main()

{

	_read(n);

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

	{

		_read(in[i].first);

		in[i].second = i;

	}

	sort(in, in + n);

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

	{

		if(in[i].second & 1 != i & 1)

			ans++;

	}

	printf("%d", ans);

	return 0;

}

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

#include<algorithm>

using namespace std;

const int maxn = 100000;

int num[maxn + 10];

int ji[maxn + 10];

int ou[maxn + 10];

int n;

int main()

{

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

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

	scanf("%d",&n);

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

	{

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

		if(i & 1)

		{

			ji[(i + 1) / 2] = num[i];

		}

		else

		{

			ou[i / 2] = num[i];

		}

	}

	sort(ji + 1,ji + 1 + (n + 1) / 2);

	sort(ou + 1,ou + 1 + n / 2);

	sort(num + 1,num + 1 + n);

	int ans = 0;

	if(n & 1)

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < (n + 1) / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < (n + 1) / 2)

				++p;

		}

	}

	else

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < n  / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < n  / 2)

				++p;

		}

	}

	printf("%d",ans);

	return 0;

}

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

#include<cstring>

#include<algorithm>

#include<set>

#define SF scanf

#define PF printf

#define MAXN 300010

#define INF 0x3FFFFFFF

using namespace std;

typedef long long ll;

int n,x,ans,suma,sumb;

set<int> a,b;

int main(){

	SF("%d",&n);

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

		SF("%d",&x);

		if(i%2==1)

			a.insert(x);

		else

			b.insert(x);

	}

	a.insert(INF);

	b.insert(INF);

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

		if(i%2==1){

			if(*a.begin()>*b.begin()){

				suma++;

				int x=*b.begin();

				b.erase(x);	

			}

			else{

				int x=*a.begin();

				a.erase(x);	

			}

		}

		else{

			if(*a.begin()<*b.begin()){

				sumb++;

				int x=*a.begin();

				a.erase(x);	

			}

			else{

				int x=*b.begin();

				b.erase(x);	

			}

		}

	}

	PF("%d",max(suma,sumb));

}

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

#include<algorithm>

using namespace std;

const int maxn = 100000;

int num[maxn + 10];

int ji[maxn + 10];

int ou[maxn + 10];

int n;

int main()

{

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

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

	scanf("%d",&n);

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

	{

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

		if(i & 1)

		{

			ji[(i + 1) / 2] = num[i];

		}

		else

		{

			ou[i / 2] = num[i];

		}

	}

	sort(ji + 1,ji + 1 + (n + 1) / 2);

	sort(ou + 1,ou + 1 + n / 2);

	sort(num + 1,num + 1 + n);

	int ans = 0;

	if(n & 1)

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < (n + 1) / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < (n + 1) / 2)

				++p;

		}

	}

	else

	{

		int p = 1;

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

		{

			while(num[i] > ji[p] && p < n  / 2)

				++p;

			if(num[i] != ji[p])

				++ans;

			while(ji[p] < num[i] && p < n  / 2)

				++p;

		}

	}

	printf("%d",ans);

	return 0;

}

// Fastest known solution for this problem: