#pragma GCC optimize ("O2")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;


using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

int P[200001];
int A[100000];
int find(int A) {
	if (P[A] < 0) return A;
	return P[A] = find(P[A]);
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	rep(i, 200001) P[i] = -1;
	int N;
	cin >> N;
	rep(i, N >> 1) cin >> A[i];
	int gomi;
	if (N & 1) cin >> gomi;

	int kotae = 0;
	for (int i = (N >> 1) - 1; i >= 0; i--) {
		int a = find(A[i]);
		int b;
		cin >> b;
		b = find(b);
		if (a == b) continue;
		if (P[a] > P[b]) swap(a, b);
		P[a] += P[b];
		P[b] = a;
		kotae++;
	}
	co(kotae);

	Would you please return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define rep(i,l,r) for(int i=l;i<r;i++)
#define inf 0x3f3f3f3f
#define PI 3.1415926
typedef long long ll;
const int maxn=25;
int n;
void solve()
{
	cin>>n;
	int x0,x1,y0,y1;
	cin>>x0>>y0>>x1>>y1;
	x1-=x0,y1-=y0;
	double ang=(n-2)*PI/n/2;
	double d=sqrt(1.0*x1*x1+1.0*y1*y1);
	double d1=d*cos(ang);
	double x=x1/d,y=y1/d;
	double u=x0+d1*(x*cos(ang)+y*sin(ang)),v=y0+d1*(y*cos(ang)-x*sin(ang));
	printf("%.10lf %.10lf\n",u,v);
}
int main()
{
    solve();
    return 0;
}