#include <iostream>
#include <cmath>

using namespace std;

int n;
double x0, z0, xn, zn, rx, ry, dx, dy, theta, c, s;

int main(){
    cin >> n;
    cin >> x0 >> z0 >> xn >> zn;

    rx = (x0 + xn)/2.0;
    ry = (z0 + zn)/2.0;
    dx = x0 - rx;
    dy = z0 - ry;
    
    c = cos(M_PI*2.0/n);
    s = sin(M_PI*2.0/n);

    // cout << rx << " " << ry << endl;
    // cout << c << " " << s << endl;
    // cout << dx << " " << dy << endl;

    printf("%9lf %9lf", rx +c*dx - s*dy, ry +s*dx + c*dy);

    // cout << rx +c*dx - s*dy << " " << rx +c*dx - s*dy<<endl;

}


 
#include <bits/stdc++.h>

#pragma region my_template

struct Rep {
  struct I {
    int i;
    void operator++() { ++i; }
    int operator*() const { return i; }
    bool operator!=(I o) const { return i < *o; }
  };
  const int l_, r_;
  Rep(int l, int r) : l_(l), r_(r) {}
  Rep(int n) : Rep(0, n) {}
  I begin() const { return {l_}; }
  I end() const { return {r_}; }
};
struct Per {
  struct I {
    int i;
    void operator++() { --i; }
    int operator*() const { return i; }
    bool operator!=(I o) const { return i > *o; }
  };
  const int l_, r_;
  Per(int l, int r) : l_(l), r_(r) {}
  Per(int n) : Per(0, n) {}
  I begin() const { return {r_ - 1}; }
  I end() const { return {l_ - 1}; }
};

template <class F>
struct Fix : private F {
  Fix(F f) : F(f) {}
  template <class... Args>
  decltype(auto) operator()(Args&&... args) const {
    return F::operator()(*this, std::forward<Args>(args)...);
  }
};

template <class T = int>
T scan() {
  T res;
  std::cin >> res;
  return res;
}

template <class T, class U = T>
bool chmin(T& a, U&& b) {
  return b < a ? a = std::forward<U>(b), true : false;
}
template <class T, class U = T>
bool chmax(T& a, U&& b) {
  return a < b ? a = std::forward<U>(b), true : false;
}

#ifndef LOCAL
#define DUMP(...) void(0)
template <int OnlineJudge, int Local>
constexpr int OjLocal = OnlineJudge;
#endif

using namespace std;

#define ALL(c) begin(c), end(c)

#pragma endregion

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  cout << fixed << setprecision(20);
  int64_t ans = 0;
  for (int n = scan(); n--;) {
    int64_t a = scan();
    int64_t b = scan();
    ans += (a + b) * (b - a + 1) / 2;
  }
  cout << ans << '\n';
}
