#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including seg_tree_order_statistics_node_update
#include <stdio.h>
#include <cassert>
using namespace std;
//using namespace __gnu_pbds;
typedef int lo;
typedef long double ld;
typedef pair<lo,lo> ll;//pair
typedef vector<lo> vl;  //vector of long
typedef vector<ll > vll;   //vector of pair
typedef priority_queue<lo>p_q;
typedef vector< vl > vvl;  //vector of vectors
#define X first
#define Y second
#define mp(a,b) make_pair((a),(b))
#define REP(a,b) for(lo i=(a);i<(lo)b;i++)//no need to declare variable i
#define REPE(a,b,c,d) REP(a,b)for(lo j=(c);j<(lo)d;j++)//no need to declare vaiables i,j
#define REPV(a,b,c) for(lo(a)=b;(a)<(c);(a)++)//a is the variable
#define IREP(a,b) for(lo i=(a);i>=(b);i--)
#define IREPV(a,b,c) for(lo(a)=b;(a)>=(c);(a)--)
#define all(v) (v).begin(),(v).end()
#define TRV(a) for(auto &it : a)
#define INF 5003
#define MOD 1000000007
#define M 1000000007
#define BLOCK 300
#define CHECK_BIT(var,pos) ((var) & (1<<(pos)))
#define pb(a) push_back((a))
#define eps 1e-8
#define PI 3.141592653589793
#define debug(x) cout<<#x<<"="<<x<<endl
#define debug2(x,y) cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define debug3(x,y,z) cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debug4(x,y,z,w) cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w<<"="<<w<<endl;
#define debug5(x,y,z,w,t) cout<<#x<<"="<<x <<" ";debug4(y,z,w,t);
#define debug6(p,x,y,z,w,t) cout<<#p<<" "<<p<<" "<<#x<<"="<<x <<" ";debug4(y,z,w,t);
#define print_matrix(a,n,m) REPE(0,n,0,m){cout<<(a)[i][j]<<((j==m-1)?'\n':' ');}
#define endl "\n"
template<typename T> ostream& operator<< ( ostream &o,vector<T> v ) {
    if ( v.size() >0 )o<<v[0];
    for ( unsigned   i=1; i<v.size(); i++ )o<<" "<<v[i];
    return o<<endl;
}
template<typename U,typename V> ostream& operator<< ( ostream &o,pair<U,V> p ) {
    return o<<"("<<p.first<<", "<<p.second<<") ";
}
template<typename T> istream& operator>> ( istream &in,vector<T> &v ) {
    for ( unsigned   i=0; i<v.size(); i++ )in>>v[i];
    return in;
}
template<typename T> istream& operator>> ( istream &in,pair <T,T> &p ) {
    in>>p.X;
    in>>p.Y;
    return in;
}
vvl dp(INF,vl (INF,-1));
string a;
void fun(lo l,lo r){
    if(r<l+2){
        dp[l][r]=0;
        return ;
    }
    lo ans=0;
    set<lo>temp;
    REP(l,r-1){
        lo x=-1;
        if(a[i]==a[i+2]){
            x=0;
            if(dp[l][i]==-1)fun(l,i);
            if(dp[i+2][r]==-1)fun(i+2,r);
            x^=dp[l][i];
            x^=dp[i+2][r];
        }
        if(x!=-1)temp.insert(x);
    }
    while(temp.find(ans)!=temp.end())ans++;
    dp[l][r]=ans;
}
int main(){
    //std::ios::sync_with_stdio(false);
	//cin.tie(0);cout.tie(0);cout.precision(20);
    cin>>a;
    REP(0,INF)dp[i][i]=0;
    fun(0,a.length()-1);
    if(dp[0][a.length()-1]==0){
        cout<<"Second";
        return 0;
    }
    cout<<"First"<<endl;
    REP(1,a.length()){
        if(dp[0][i-1]^dp[i+1][a.length()-1]==0){
            cout<<i+1;
            return 0;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including seg_tree_order_statistics_node_update
#include <stdio.h>
#include <cassert>
using namespace std;
//using namespace __gnu_pbds;
typedef int lo;
typedef long double ld;
typedef pair<lo,lo> ll;//pair
typedef vector<lo> vl;  //vector of long
typedef vector<ll > vll;   //vector of pair
typedef priority_queue<lo>p_q;
typedef vector< vl > vvl;  //vector of vectors
#define X first
#define Y second
#define mp(a,b) make_pair((a),(b))
#define REP(a,b) for(lo i=(a);i<(lo)b;i++)//no need to declare variable i
#define REPE(a,b,c,d) REP(a,b)for(lo j=(c);j<(lo)d;j++)//no need to declare vaiables i,j
#define REPV(a,b,c) for(lo(a)=b;(a)<(c);(a)++)//a is the variable
#define IREP(a,b) for(lo i=(a);i>=(b);i--)
#define IREPV(a,b,c) for(lo(a)=b;(a)>=(c);(a)--)
#define all(v) (v).begin(),(v).end()
#define TRV(a) for(auto &it : a)
#define INF 5003
#define MOD 1000000007
#define M 1000000007
#define BLOCK 300
#define CHECK_BIT(var,pos) ((var) & (1<<(pos)))
#define pb(a) push_back((a))
#define eps 1e-8
#define PI 3.141592653589793
#define debug(x) cout<<#x<<"="<<x<<endl
#define debug2(x,y) cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define debug3(x,y,z) cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debug4(x,y,z,w) cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w<<"="<<w<<endl;
#define debug5(x,y,z,w,t) cout<<#x<<"="<<x <<" ";debug4(y,z,w,t);
#define debug6(p,x,y,z,w,t) cout<<#p<<" "<<p<<" "<<#x<<"="<<x <<" ";debug4(y,z,w,t);
#define print_matrix(a,n,m) REPE(0,n,0,m){cout<<(a)[i][j]<<((j==m-1)?'\n':' ');}
#define endl "\n"
template<typename T> ostream& operator<< ( ostream &o,vector<T> v ) {
    if ( v.size() >0 )o<<v[0];
    for ( unsigned   i=1; i<v.size(); i++ )o<<" "<<v[i];
    return o<<endl;
}
template<typename U,typename V> ostream& operator<< ( ostream &o,pair<U,V> p ) {
    return o<<"("<<p.first<<", "<<p.second<<") ";
}
template<typename T> istream& operator>> ( istream &in,vector<T> &v ) {
    for ( unsigned   i=0; i<v.size(); i++ )in>>v[i];
    return in;
}
template<typename T> istream& operator>> ( istream &in,pair <T,T> &p ) {
    in>>p.X;
    in>>p.Y;
    return in;
}
vl G(INF,0);
string a;
bool check(){
    lo ans=0;//debug(a);
    lo add=0;
    REP(1,a.length()-1){
        if(a[i-1]==a[i+1] and a[i]!='$')add++;
        else{
            ans^=G[add];
            add=0;
        }
    }
    return ans==0;
}
int main(){
    std::ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);cout.precision(20);
    G[0]=0;
    G[1]=1;
    REP(2,INF){
        set<lo>temp;
        REPV(j,0,i){
            if(j==0 or j==i-1)temp.insert(G[i-2]);
            else temp.insert(G[j-1]^G[i-j-2]);
        }
        while(temp.find(G[i])!=temp.end())G[i]++;
    }
    cin>>a;
    a+="#";
    REP(1,a.length()-1)if(a[i-1]==a[i+1]){
        char c=a[i];
        //debug(i);
        a[i]='$';
        if(check()){
            cout<<"First"<<endl;
            cout<<i+1<<endl;
            return 0;
        }
        a[i]=c;
    }
    cout<<"Second";
    return 0;
}


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including seg_tree_order_statistics_node_update
#include <stdio.h>
#include <cassert>
using namespace std;
//using namespace __gnu_pbds;
typedef int lo;
typedef long double ld;
typedef pair<lo,lo> ll;//pair
typedef vector<lo> vl;  //vector of long
typedef vector<ll > vll;   //vector of pair
typedef priority_queue<lo>p_q;
typedef vector< vl > vvl;  //vector of vectors
#define X first
#define Y second
#define mp(a,b) make_pair((a),(b))
#define REP(a,b) for(lo i=(a);i<(lo)b;i++)//no need to declare variable i
#define REPE(a,b,c,d) REP(a,b)for(lo j=(c);j<(lo)d;j++)//no need to declare vaiables i,j
#define REPV(a,b,c) for(lo(a)=b;(a)<(c);(a)++)//a is the variable
#define IREP(a,b) for(lo i=(a);i>=(b);i--)
#define IREPV(a,b,c) for(lo(a)=b;(a)>=(c);(a)--)
#define all(v) (v).begin(),(v).end()
#define TRV(a) for(auto &it : a)
#define INF 5003
#define MOD 1000000007
#define M 1000000007
#define BLOCK 300
#define CHECK_BIT(var,pos) ((var) & (1<<(pos)))
#define pb(a) push_back((a))
#define eps 1e-8
#define PI 3.141592653589793
#define debug(x) cout<<#x<<"="<<x<<endl
#define debug2(x,y) cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define debug3(x,y,z) cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debug4(x,y,z,w) cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w<<"="<<w<<endl;
#define debug5(x,y,z,w,t) cout<<#x<<"="<<x <<" ";debug4(y,z,w,t);
#define debug6(p,x,y,z,w,t) cout<<#p<<" "<<p<<" "<<#x<<"="<<x <<" ";debug4(y,z,w,t);
#define print_matrix(a,n,m) REPE(0,n,0,m){cout<<(a)[i][j]<<((j==m-1)?'\n':' ');}
#define endl "\n"
template<typename T> ostream& operator<< ( ostream &o,vector<T> v ) {
    if ( v.size() >0 )o<<v[0];
    for ( unsigned   i=1; i<v.size(); i++ )o<<" "<<v[i];
    return o<<endl;
}
template<typename U,typename V> ostream& operator<< ( ostream &o,pair<U,V> p ) {
    return o<<"("<<p.first<<", "<<p.second<<") ";
}
template<typename T> istream& operator>> ( istream &in,vector<T> &v ) {
    for ( unsigned   i=0; i<v.size(); i++ )in>>v[i];
    return in;
}
template<typename T> istream& operator>> ( istream &in,pair <T,T> &p ) {
    in>>p.X;
    in>>p.Y;
    return in;
}
vl G(INF,0);
string a;
bool check(){
    lo ans=0;//debug(a);
    lo add=0;
    REP(1,a.length()-1){
        if(a[i-1]==a[i+1] and a[i]!='$')add++;
        else{
            ans^=G[add];
            add=0;
        }
    }
    return ans==0;
}
int main(){
    std::ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);cout.precision(20);
    G[0]=0;
    G[1]=1;
    REP(2,INF){
        set<lo>temp;
        REPV(j,0,i){
            if(j==0 or j==i-1)temp.insert(1);
            else temp.insert(G[j-1]^G[i-j-2]);
        }
        while(temp.find(G[i])!=temp.end())G[i]++;
    }
    cin>>a;
    a+="#";
    REP(1,a.length()-1)if(a[i-1]==a[i+1]){
        char c=a[i];
        //debug(i);
        a[i]='$';
        if(check()){
            cout<<"First"<<endl;
            cout<<i+1<<endl;
            return 0;
        }
        a[i]=c;
    }
    cout<<"Second";
    return 0;
}


#include<iostream>
#include<algorithm>
#include<queue>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<set>
#include<cstring>
#include<ctime>
#include<cmath>
#include<iterator>
#include<functional>
#include<stack>
#define all(v) v.begin(), v.end()
#define setv(ar, val) memset(ar, val, sizeof(ar));
#define ll long long int
#define ull unsigned long long int
#define PI 3.1415926535897932384626433832795
#pragma comment(linker, "/STACK:1073741824")
using namespace std;

const int N = 5010;
char s[N];
int d[N];
map<int, int> to[N];

int main() {
#pragma warning(disable : 4996)
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	scanf("%s", s);
	int len = strlen(s);

	for (int i = 1; i < len; i++) {
		for (int j = 1; j <= i; j++) {
			int a = max(0, j - 2), b = max(0, i - j - 1);
			if (!to[i].count(d[a] ^ d[b]))
				to[i][d[a] ^ d[b]] = j;
		}
		auto it = to[i].begin();
		for (int j = 0;; j++, it++) {
			if (it == to[i].end() || j != it->first) {
				d[i] = j;
				break;
			}
		}
	}

	int c = 0, ans = 0;
	for (int i = 0; i < len; i++) {
		if (i == len - 2 || s[i] != s[i + 2]) {
			ans ^= d[c];
			c = 0;
		}
		else
			c++;
	}

	if (ans == 0)
		printf("Second");
	else {
		int l = -1;
		for (int i = 0; i < len; i++) {
			if (i == len - 2 || s[i] != s[i + 2]) {
				if (to[c].count(d[c] ^ ans)) {
					printf("First\n%d", to[c][d[c] ^ ans] + l);
					return 0;
				}
				l = -1;
				c = 0;
			}
			else {
				if (l == -1)
					l = i + 1;
				c++;
			}
		}
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;
using namespace placeholders;

template <class T> void mini(T &l, T r) {l = min(l, r);}
template <class T> void maxi(T &l, T r) {l = max(l, r);}

template <class TH> void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <class TH, class ...TA> void _dbg(const char *sdbg, TH h, TA ...a) {
  while (*sdbg != ',') cerr << *sdbg++; cerr << "=" << h << ","; _dbg(sdbg + 1, a...);
}
template <class T> ostream &operator<<(ostream &os, vector <T> v) {
  os << "[";
  for (auto vv : v) os << vv << ",";
  return os << "]";
}
template <class L, class R> ostream &operator<<(ostream &os, pair <L, R> p) {
  return os << "(" << p.first << "," << p.second << ")";
}

#define eput(...) //_dbg(#__VA_ARGS__, __VA_ARGS__)

const int N = 5010;

char s[N];
int fl[N];
int sg[N];

int go(int x) {
  if (sg[x] != -1) return sg[x];
  set <int> st;
  int &ret = sg[x];
  for (int i = 1; i <= x; ++i) {
    int l = i - 2;
    int r = x - (i + 1);
    int t = 0;
    if (l >= 0) t ^= go(l);
    if (r >= 0) t ^= go(r);
    st.insert(t);
  }
  for (int i = 0; ; ++i) if (!st.count(i)) return ret = i;
}

void init() {
  fill_n(sg, N, -1);
  sg[0] = 0;
  for (int i = 1; i < N; ++i) {
    sg[i] = go(i);
  }

  //for (int i = 1; i < N; ++i) eput(i, sg[i]);
}

void run() {
  init();
  scanf("%s", s);
  int n = strlen(s);
  for (int i = 1; i + 1 < n; ++i) {
    if (s[i - 1] == s[i + 1]) fl[i] = 1;
  }

  vector < pair <int, int> > v;
  for (int i = 0; i < n; ++i) {
    if (fl[i]) {
      if (v.empty() || v.back().second + 1 < i) {
        v.push_back(make_pair(i, i));
      } else {
        v.back().second = i;
      }
    }
  }

  //eput(v);

  int t = 0;

  for (auto p : v) {
    t ^= go(p.second - p.first + 1);
  }

  puts(t ? "First" : "Second");

  if (t) {
    //eput(t);
    int ps = -1;
    for (auto p : v) {
      int x = p.second - p.first + 1;
      auto left = go(x) ^ t;
      //eput(left);
      for (int i = 1; i <= x; ++i) {
        int l = i - 2;
        int r = x - (i + 1);
        int t1 = 0;
        if (l >= 0) t1 ^= go(l);
        if (r >= 0) t1 ^= go(r);
        t1 ^= left;
        //eput(t1);
        if (t1 == 0) {
          ps = p.first + i - 1;
          break;
        }
      }
      if (ps != -1) break;
    }

    printf("%d\n", ps + 1);

  }

}

int main() {
  run();
  return 0;
}


#include <bits/stdc++.h>

using namespace std;
using namespace placeholders;

template <class T> void mini(T &l, T r) {l = min(l, r);}
template <class T> void maxi(T &l, T r) {l = max(l, r);}

template <class TH> void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <class TH, class ...TA> void _dbg(const char *sdbg, TH h, TA ...a) {
  while (*sdbg != ',') cerr << *sdbg++; cerr << "=" << h << ","; _dbg(sdbg + 1, a...);
}
template <class T> ostream &operator<<(ostream &os, vector <T> v) {
  os << "[";
  for (auto vv : v) os << vv << ",";
  return os << "]";
}
template <class L, class R> ostream &operator<<(ostream &os, pair <L, R> p) {
  return os << "(" << p.first << "," << p.second << ")";
}

#define eput(...) //_dbg(#__VA_ARGS__, __VA_ARGS__)

const int N = 5010;

char s[N];
int fl[N];
int sg[N];

int go(int x) {
  if (sg[x] != -1) return sg[x];
  set <int> st;
  int &ret = sg[x];
  for (int i = 1; i <= x; ++i) {
    int l = i - 2;
    int r = x - (i + 1);
    int t = 0;
    if (l >= 0) t ^= go(l);
    if (r >= 0) t ^= go(r);
    st.insert(t);
  }
  for (int i = 1; ; ++i) if (!st.count(i)) return ret = i;
}

void init() {
  fill_n(sg, N, -1);
  sg[0] = 0;
  for (int i = 1; i < N; ++i) {
    sg[i] = go(i);
  }
}

void run() {
  init();
  scanf("%s", s);
  int n = strlen(s);
  for (int i = 1; i + 1 < n; ++i) {
    if (s[i - 1] == s[i + 1]) fl[i] = 1;
  }

  vector < pair <int, int> > v;
  for (int i = 0; i < n; ++i) {
    if (fl[i]) {
      if (v.empty() || v.back().second + 1 < i) {
        v.push_back(make_pair(i, i));
      } else {
        v.back().second = i;
      }
    }
  }

  eput(v);

  int t = 0;

  for (auto p : v) {
    t ^= go(p.second - p.first + 1);
  }

  puts(t ? "First" : "Second");

  if (t) {
    eput(t);
    int ps = -1;
    for (auto p : v) {
      int x = p.second - p.first + 1;
      auto left = go(x) ^ t;
      for (int i = 1; i <= x; ++i) {
        int l = i - 2;
        int r = x - (i + 1);
        int t1 = 0;
        if (l >= 0) t1 ^= go(l);
        if (r >= 0) t1 ^= go(r);
        t1 ^= left;
        if (t1 == 0) {
          ps = p.first + i - 1;
          break;
        }
      }
      if (ps != -1) break;
    }

    printf("%d\n", ps + 1);

  }

}

int main() {
  run();
  return 0;
}


#include <bits/stdc++.h>

using namespace std;
using namespace placeholders;

template <class T> void mini(T &l, T r) {l = min(l, r);}
template <class T> void maxi(T &l, T r) {l = max(l, r);}

template <class TH> void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <class TH, class ...TA> void _dbg(const char *sdbg, TH h, TA ...a) {
  while (*sdbg != ',') cerr << *sdbg++; cerr << "=" << h << ","; _dbg(sdbg + 1, a...);
}
template <class T> ostream &operator<<(ostream &os, vector <T> v) {
  os << "[";
  for (auto vv : v) os << vv << ",";
  return os << "]";
}
template <class L, class R> ostream &operator<<(ostream &os, pair <L, R> p) {
  return os << "(" << p.first << "," << p.second << ")";
}

#define eput(...) _dbg(#__VA_ARGS__, __VA_ARGS__)

const int N = 5010;

char s[N];
int fl[N];
int sg[N];

int go(int x) {
  if (sg[x] != -1) return sg[x];
  set <int> st;
  int &ret = sg[x];
  for (int i = 1; i <= x; ++i) {
    int l = i - 2;
    int r = x - (i + 1);
    int t = 0;
    if (l >= 0) t ^= go(l);
    if (r >= 0) t ^= go(r);
  }
  for (int i = 1; ; ++i) if (!st.count(i)) return ret = i;
}

void init() {
  fill_n(sg, N, -1);
  sg[0] = 0;
  for (int i = 1; i < N; ++i) {
    sg[i] = go(i);
  }
}

void run() {
  init();
  scanf("%s", s);
  int n = strlen(s);
  for (int i = 1; i + 1 < n; ++i) {
    if (s[i - 1] == s[i + 1]) fl[i] = 1;
  }

  vector < pair <int, int> > v;
  for (int i = 0; i < n; ++i) {
    if (fl[i]) {
      if (v.empty() || v.back().second + 1 < i) {
        v.push_back(make_pair(i, i));
      } else {
        v.back().second = i;
      }
    }
  }

  int t = 0;

  for (auto p : v) {
    t ^= go(p.second - p.first + 1);
  }

  puts(t ? "First" : "Second");

  if (t) {
    int ps = -1;
    for (auto p : v) {
      int x = p.second - p.first + 1;
      auto left = go(x) ^ t;
      for (int i = 1; i <= x; ++i) {
        int l = i - 2;
        int r = x - (i + 1);
        int t1 = 0;
        if (l >= 0) t1 ^= go(l);
        if (r >= 0) t1 ^= go(r);
        t1 ^= left;
        if (t1 == 0) {
          ps = p.first + i - 1;
          break;
        }
      }
      if (ps != -1) break;
    }

    printf("%d\n", ps + 1);

  }

}

int main() {
  run();
  return 0;
}


#include <iostream>
#include <set>
#include<fstream>

using namespace std;

const int N = 5007;

int gn[N];

string s;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);

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

    cin >> s;

    gn[0] = 0;
    gn[1] = 1;
    gn[2] = 1;

    for(int i = 3; i <= s.size(); i++){
        set<int> mex;
        mex.insert(gn[i - 2]);
        for(int j = 0; j <= i - 3; j++){
            mex.insert(gn[j] ^ gn[i-3-j]);
        }
        set<int> :: iterator it = mex.begin();

        gn[i] = 0;

        while(it != mex.end() && *it == gn[i]){
            it++;
            gn[i]++;
        }
    }

    int curr = 0, res = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{
            res ^= gn[curr];
            curr = 0;
        }
    }

    res ^= gn[curr];

    //cout << res << endl;

    if(!res){
        cout << "Second\n";

        return 0;
    }

    cout << "First\n";

    curr = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{

            if(curr >= 1){
                //cout << curr << " curr i " << i << endl;
                if((res ^ gn[curr] ^ gn[max(curr - 2, 0)]) == 0){
                    cout << i - curr + 1 << "\n";

                    return 0;
                }

                if(curr >= 3){
                    for(int j = 0; j < curr - 2; j++){
                        if((res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr]) == 0){
                            cout << i - curr + j + 2  << "\n";

                            return 0;
                        }
                    }
                }
            }

            curr = 0;
        }
    }

    if(curr >= 1){
        int i = s.size() - 1;

        if((res ^ gn[curr] ^ gn[max(curr - 2, 0)]) == 0){
            cout << i - curr + 1 << "\n";

            return 0;
        }

        if(curr >= 3){
            //cout << curr << " curr\n";
            //cout << gn[curr] << " " << res << endl;

            for(int j = 0; j < curr - 2; j++){
                if((res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr]) == 0){
                    //cout << gn[j] << " " << gn[curr - j - 3] << endl;
                    cout << i - curr + j + 2  << "\n";

                    return 0;
                }
            }
        }
    }

    //system("pause");

    return 0;
}
/*
aaaaaaa
*/


#include <iostream>
#include <set>

using namespace std;

const int N = 5007;

int gn[N];

string s;

int main(){
    //ios::sync_with_stdio(false);
    //cin.tie(NULL);

    cin >> s;

    gn[0] = 0;
    gn[1] = 1;
    gn[2] = 1;

    for(int i = 3; i <= s.size(); i++){
        set<int> mex;
        mex.insert(gn[i - 2]);
        for(int j = 0; j <= i - 3; j++){
            mex.insert(gn[j] ^ gn[i-3-j]);
        }
        set<int> :: iterator it = mex.begin();

        gn[i] = 0;

        while(it != mex.end() && *it == gn[i]){
            it++;
            gn[i]++;
        }
    }

    int curr = 0, res = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{
            res ^= gn[curr];
            curr = 0;
        }
    }

    res ^= gn[curr];

    cout << res << endl;

    if(!res){
        cout << "Second\n";

        return 0;
    }

    cout << "First\n";

    curr = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{

            if(curr >= 1){
                //cout << curr << " curr i " << i << endl;
                if(res ^ gn[curr] ^ gn[max(curr - 2, 0)] == 0){
                    cout << i - curr + 1 << "\n";

                    return 0;
                }

                if(curr >= 3){
                    for(int j = 0; j < curr - 2; j++){
                        if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
                            cout << i - curr + j + 2  << "\n";

                            return 0;
                        }
                    }
                }
            }

            curr = 0;
        }
    }

    if(curr >= 1){
        int i = s.size() - 1;

        if(res ^ gn[curr] ^ gn[max(curr - 2, 0)] == 0){
            cout << i - curr + 1 << "\n";

            return 0;
        }

        if(curr >= 3){
            for(int j = 0; j < curr - 2; j++){
                if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
                    cout << i - curr + j + 2  << "\n";

                    return 0;
                }
            }
        }
    }

    //system("pause");

    return 0;
}


#include <iostream>
#include <set>

using namespace std;

const int N = 5007;

int gn[N];

string s;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> s;

    gn[0] = 0;
    gn[1] = 0;
    gn[2] = 0;

    for(int i = 3; i <= s.size(); i++){
        set<int> mex;
        for(int j = 0; j <= i - 3; j++){
            mex.insert(gn[j] ^ gn[i-3-j]);
        }
        set<int> :: iterator it = mex.begin();

        gn[i] = 0;

        while(it != mex.end() && *it == gn[i]){
            it++;
            gn[i]++;
        }
    }

    int curr = 0, res = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            if(curr == 0){
                curr = 3;
            }
            else{
                curr++;
            }
        }
        else{
            res ^= gn[curr];
            curr = 0;
        }
    }

    res ^= gn[curr];

    cout << res << endl;

    if(!res){
        cout << "Second\n";

        return 0;
    }

    cout << "First\n";

    curr = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            if(curr == 0){
                curr = 3;
            }
            else{
                curr++;
            }
        }
        else{

            if(curr >= 3){
                for(int j = 0; j < curr; j++){
                    if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
                        cout << i + j  << "\n";

                        return 0;
                    }
                }
            }

            curr = 0;
        }
    }

    for(int j = 0; j < curr; j++){
        if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
            cout << s.size() - 2 + j  << "\n";

            return 0;
        }
    }

    //system("pause");

    return 0;
}


#include <iostream>
#include <set>

using namespace std;

const int N = 5007;

int gn[N];

string s;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> s;

    gn[0] = 0;
    gn[1] = 0;
    gn[2] = 0;

    for(int i = 3; i <= s.size(); i++){
        set<int> mex;
        for(int j = 0; j <= i - 3; j++){
            mex.insert(gn[j] ^ gn[i-3-j]);
        }
        set<int> :: iterator it = mex.begin();

        gn[i] = 0;

        while(it != mex.end() && *it == gn[i]){
            it++;
            gn[i]++;
        }
    }

    int curr = 0, res = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            if(curr == 0){
                curr = 3;
            }
            else{
                curr++;
            }
        }
        else{
            res ^= gn[curr];
            curr = 0;
        }
    }

    res ^= gn[curr];

    //cout << res << endl;

    if(!res){
        cout << "Second\n";

        return 0;
    }

    cout << "First\n";

    curr = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            if(curr == 0){
                curr = 3;
            }
            else{
                curr++;
            }
        }
        else{

            if(curr >= 3){
                for(int j = 0; j < curr; j++){
                    if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
                        cout << i + j  << "\n";

                        return 0;
                    }
                }
            }

            curr = 0;
        }
    }

    for(int j = 0; j < curr; j++){
        if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
            cout << s.size() - 2 + j  << "\n";

            return 0;
        }
    }

    //system("pause");

    return 0;
}


#include <iostream>
#include <set>

using namespace std;

const int N = 5007;

int gn[N];

string s;

int main(){
    //ios::sync_with_stdio(false);
    //cin.tie(NULL);

    cin >> s;

    gn[0] = 0;
    gn[1] = 1;
    gn[2] = 1;

    for(int i = 3; i <= s.size(); i++){
        set<int> mex;
        mex.insert(gn[i - 2]);
        for(int j = 0; j <= i - 3; j++){
            mex.insert(gn[j] ^ gn[i-3-j]);
        }
        set<int> :: iterator it = mex.begin();

        gn[i] = 0;

        while(it != mex.end() && *it == gn[i]){
            it++;
            gn[i]++;
        }
    }

    int curr = 0, res = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{
            res ^= gn[curr];
            curr = 0;
        }
    }

    res ^= gn[curr];

    //cout << res << endl;

    if(!res){
        cout << "Second\n";

        return 0;
    }

    cout << "First\n";

    curr = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{

            if(curr >= 1){
                //cout << curr << " curr i " << i << endl;
                if(res ^ gn[curr] ^ gn[max(curr - 2, 0)] == 0){
                    cout << i - curr + 1 << "\n";

                    return 0;
                }

                if(curr >= 3){
                    for(int j = 0; j < curr - 2; j++){
                        if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
                            cout << i - curr + j + 2  << "\n";

                            return 0;
                        }
                    }
                }
            }

            curr = 0;
        }
    }

    if(curr >= 1){
        int i = s.size() - 1;

        if(res ^ gn[curr] ^ gn[max(curr - 2, 0)] == 0){
            cout << i - curr + 1 << "\n";

            return 0;
        }

        if(curr >= 3){
            for(int j = 0; j < curr - 2; j++){
                if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
                    cout << i - curr + j + 2  << "\n";

                    return 0;
                }
            }
        }
    }

    //system("pause");

    return 0;
}


#include <iostream>
#include <set>
#include<fstream>

using namespace std;

const int N = 5007;

int gn[N];

string s;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    freopen("output.txt", "w", stdout);

    cin >> s;

    gn[0] = 0;
    gn[1] = 1;
    gn[2] = 1;

    for(int i = 3; i <= s.size(); i++){
        set<int> mex;
        mex.insert(gn[i - 2]);
        for(int j = 0; j <= i - 3; j++){
            mex.insert(gn[j] ^ gn[i-3-j]);
        }
        set<int> :: iterator it = mex.begin();

        gn[i] = 0;

        while(it != mex.end() && *it == gn[i]){
            it++;
            gn[i]++;
        }
    }

    int curr = 0, res = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{
            res ^= gn[curr];
            curr = 0;
        }
    }

    res ^= gn[curr];

    //cout << res << endl;

    if(!res){
        cout << "Second\n";

        return 0;
    }

    cout << "First\n";

    curr = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{

            if(curr >= 1){
                //cout << curr << " curr i " << i << endl;
                if((res ^ gn[curr] ^ gn[max(curr - 2, 0)]) == 0){
                    cout << i - curr + 1 << "\n";

                    return 0;
                }

                if(curr >= 3){
                    for(int j = 0; j < curr - 2; j++){
                        if((res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr]) == 0){
                            cout << i - curr + j + 2  << "\n";

                            return 0;
                        }
                    }
                }
            }

            curr = 0;
        }
    }

    if(curr >= 1){
        int i = s.size() - 1;

        if((res ^ gn[curr] ^ gn[max(curr - 2, 0)]) == 0){
            cout << i - curr + 1 << "\n";

            return 0;
        }

        if(curr >= 3){
            //cout << curr << " curr\n";
            //cout << gn[curr] << " " << res << endl;

            for(int j = 0; j < curr - 2; j++){
                if((res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr]) == 0){
                    //cout << gn[j] << " " << gn[curr - j - 3] << endl;
                    cout << i - curr + j + 2  << "\n";

                    return 0;
                }
            }
        }
    }

    //system("pause");

    return 0;
}
/*
aaaaaaa
*/


#include <iostream>
#include <set>

using namespace std;

const int N = 5007;

int gn[N];

string s;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> s;

    gn[0] = 0;
    gn[1] = 0;
    gn[2] = 0;

    for(int i = 3; i <= s.size(); i++){
        set<int> mex;
        for(int j = 0; j <= i - 3; j++){
            mex.insert(gn[j] ^ gn[i-3-j]);
        }
        set<int> :: iterator it = mex.begin();

        gn[i] = 0;

        while(it != mex.end() && *it == gn[i]){
            it++;
            gn[i]++;
        }
    }

    int curr = 0, res = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            if(curr == 0){
                curr = 3;
            }
            else{
                curr++;
            }
        }
        else{
            res ^= gn[curr];
            curr = 0;
        }
    }

    res ^= gn[curr];

    if(!res){
        cout << "Second\n";

        return 0;
    }

    cout << "First\n";

    curr = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            if(curr == 0){
                curr = 3;
            }
            else{
                curr++;
            }
        }
        else{

            if(curr >= 3){
                for(int j = 0; j < curr; j++){
                    if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
                        cout << i + j  << "\n";

                        return 0;
                    }
                }
            }

            curr = 0;
        }
    }

    for(int j = 0; j < curr; j++){
        if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
            cout << s.size() - 1 + j  << "\n";

            return 0;
        }
    }

    //system("pause");

    return 0;
}


#include <iostream>
#include <set>

using namespace std;

const int N = 5007;

int gn[N];

string s;

int main(){
    //ios::sync_with_stdio(false);
    //cin.tie(NULL);

    cin >> s;

    gn[0] = 0;
    gn[1] = 1;
    gn[2] = 1;

    for(int i = 3; i <= s.size(); i++){
        set<int> mex;
        mex.insert(gn[i - 2]);
        for(int j = 0; j <= i - 3; j++){
            mex.insert(gn[j] ^ gn[i-3-j]);
        }
        set<int> :: iterator it = mex.begin();

        gn[i] = 0;

        while(it != mex.end() && *it == gn[i]){
            it++;
            gn[i]++;
        }
    }

    int curr = 0, res = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{
            res ^= gn[curr];
            curr = 0;
        }
    }

    res ^= gn[curr];

    //cout << res << endl;

    if(!res){
        cout << "Second\n";

        return 0;
    }

    cout << "First\n";

    curr = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{

            if(curr >= 1){
                //cout << curr << " curr i " << i << endl;
                if(res ^ gn[curr] ^ gn[max(curr - 2, 0)] == 0){
                    cout << i - curr << "\n";

                    return 0;
                }

                if(curr >= 3){
                    for(int j = 0; j < curr - 2; j++){
                        if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
                            cout << i - curr + j + 1  << "\n";

                            return 0;
                        }
                    }
                }
            }

            curr = 0;
        }
    }

    if(curr >= 1){
        int i = s.size() - 2;

        if(res ^ gn[curr] ^ gn[max(curr - 2, 0)] == 0){
            cout << i - curr << "\n";

            return 0;
        }

        if(curr >= 3){
            for(int j = 0; j < curr - 2; j++){
                if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
                    cout << i - curr + j + 1  << "\n";

                    return 0;
                }
            }
        }
    }

    //system("pause");

    return 0;
}


#include <iostream>
#include <set>

using namespace std;

const int N = 5007;

int gn[N];

string s;

int main(){
    //ios::sync_with_stdio(false);
    //cin.tie(NULL);

    cin >> s;

    gn[0] = 0;
    gn[1] = 1;
    gn[2] = 1;

    for(int i = 3; i <= s.size(); i++){
        set<int> mex;
        mex.insert(gn[i - 2]);
        for(int j = 0; j <= i - 3; j++){
            mex.insert(gn[j] ^ gn[i-3-j]);
        }
        set<int> :: iterator it = mex.begin();

        gn[i] = 0;

        while(it != mex.end() && *it == gn[i]){
            it++;
            gn[i]++;
        }
    }

    int curr = 0, res = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{
            res ^= gn[curr];
            curr = 0;
        }
    }

    res ^= gn[curr];

    //cout << res << endl;

    if(!res){
        cout << "Second\n";

        return 0;
    }

    cout << "First\n";

    curr = 0;

    for(int i = 1; i < s.size() - 1; i++){
        if(s[i+1] == s[i-1]){
            curr++;
        }
        else{

            if(curr >= 1){
                //cout << curr << " curr i " << i << endl;
                if(res ^ gn[curr] ^ gn[max(curr - 2, 0)] == 0){
                    cout << i - curr + 1 << "\n";

                    return 0;
                }

                if(curr >= 3){
                    for(int j = 0; j < curr - 2; j++){
                        if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
                            cout << i - curr + j + 2  << "\n";

                            return 0;
                        }
                    }
                }
            }

            curr = 0;
        }
    }

    if(curr >= 1){
        int i = s.size() - 2;

        if(res ^ gn[curr] ^ gn[max(curr - 2, 0)] == 0){
            cout << i - curr + 1 << "\n";

            return 0;
        }

        if(curr >= 3){
            for(int j = 0; j < curr - 2; j++){
                if(res ^ gn[j] ^ gn[curr - j - 3] ^ gn[curr] == 0){
                    cout << i - curr + j + 2  << "\n";

                    return 0;
                }
            }
        }
    }

    //system("pause");

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=5005;
char s[N];
int n,v[N],sg[N];
int calc(int l,int r){
	int x=0,lst=0;
	for(int i=l+1;i<r;i++)
		if(s[i-1]==s[i+1])lst++;
		else x^=sg[lst],lst=0;
	return x^=sg[lst];
}
int main(){
	scanf("%s",s+1);
	n=strlen(s+1);
	sg[1]=1;
	for(int i=2;i<=n;i++){
		v[sg[i-2]]=i;
		for(int j=2;j<=i-1;j++)
			v[min(sg[j-2]^sg[i-j-1],n+1)]=i;
		int x=0;
		while(v[x]==i)x++;
		sg[i]=x;
	}
	if(calc(1,n)){
		puts("First");
		int k;
		for(k=2;k<n;k++)
			if(s[k-1]==s[k+1]&&(calc(1,k-1)^calc(k+1,n))==0){
				printf("%d\n",k);
				return 0;
			}
	}else puts("Second");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=5005;
int n,vis[maxn],g[maxn],col[maxn],pre[maxn],suf[maxn];
char s[maxn];
int main(){
  //freopen("aa.in","r",stdin);
  scanf("%s",s+1);
  n=strlen(s+1);
  for(int k=1;k<=n;k++){
    for(int i=2;i<k;i++){
      vis[g[i-1]^g[n-i]]=k;
    }
    for(g[k]=0;vis[g[k]]==k;g[k]++);
  }
  vector< pair<int,int> > seg;
  for(int i=1;i<n;){
    int j=i+1;
    for(;j<n && s[j+1]==s[j-1];j++);
    for(int k=i+1;k<j;k++)col[k]=1;
    i=j;
  }
  int now=0;
  int sum=0;
  for(int i=1;i<=n;i++){
    if(col[i]){
      now++;
      pre[i]=sum^g[now+2];
    }else{
      sum^=g[now+2];
      now=0;
      pre[i]=sum;
    }
  }
  now=sum=0;
  for(int i=n;i;i--){
    if(col[i]){
      now++;
      suf[i]=sum^g[now+2];
    }else{
      sum^=g[now+2];
      now=0;
      suf[i]=sum;
    }
  }
  int ans=0;
  for(int i=2;i<n;i++){
    if(col[i] && (pre[i-1]^suf[i+1])==0){
      ans=i;
      break;
    }
  }
  if(ans==0)puts("Second");
  else{
    printf("First\n%d\n",ans);
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=5005;
int n,vis[maxn],g[maxn],col[maxn],pre[maxn],suf[maxn];
char s[maxn];
int main(){
  //freopen("aa.in","r",stdin);
  scanf("%s",s+1);
  n=strlen(s+1);
  for(int k=1;k<=n;k++){
    for(int i=2;i<k;i++){
      vis[g[i-1]^g[n-i]]=k;
    }
    for(g[k]=0;vis[g[k]]==k;g[k]++);
  }
  for(int i=1;i<n;){
    int j=i+1;
    for(;j<n && s[j+1]==s[j-1];j++);
    for(int k=i+1;k<j;k++)col[k]=1;
    i=j;
  }
  int now=0;
  int sum=0;
  for(int i=1;i<=n;i++){
    if(col[i]){
      now++;
      pre[i]=sum^g[now+2];
    }else{
      sum^=g[now+2];
      now=0;
      pre[i]=sum;
    }
  }
  now=sum=0;
  for(int i=n;i;i--){
    if(col[i]){
      now++;
      suf[i]=sum^g[now+2];
    }else{
      sum^=g[now+2];
      now=0;
      suf[i]=sum;
    }
  }
  int ans=0;
  for(int i=2;i<n;i++){
    if(col[i] && (pre[i-2]^suf[i+2])==0){
      ans=i;
      break;
    }
  }
  if(ans==0)puts("Second");
  else{
    printf("First\n%d\n",ans);
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=5005;
int n,vis[1<<14],g[maxn],col[maxn],pre[maxn],suf[maxn];
char s[maxn];
int main(){
  //freopen("aa.in","r",stdin);
  scanf("%s",s+1);
  n=strlen(s+1);
  for(int k=1;k<=n;k++){
    for(int i=2;i<k;i++){
      vis[g[i-1]^g[k-i]]=k;
    }
    for(g[k]=0;vis[g[k]]==k;g[k]++);
  }
  for(int i=1;i<n;){
    int j=i+1;
    for(;j<n && s[j+1]==s[j-1];j++);
    for(int k=i+1;k<j;k++)col[k]=1;
    i=j;
  }
  int now=0;
  int sum=0;
  for(int i=2;i<=n;i++){
    if(col[i-1]){
      now++;
      pre[i]=sum^g[now+2];
    }else{
      sum^=g[now+2];
      now=0;
      pre[i]=sum;
    }
  }
  now=sum=0;
  for(int i=n-1;i;i--){
    if(col[i+1]){
      now++;
      suf[i]=sum^g[now+2];
    }else{
      sum^=g[now+2];
      now=0;
      suf[i]=sum;
    }
  }
  int ans=0;
  for(int i=2;i<n;i++){
    if(col[i] && (pre[i-1]^suf[i+1])==0){
      ans=i;
      break;
    }
  }
  if(ans==0)puts("Second");
  else{
    printf("First\n%d\n",ans);
  }
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define per(i, a, b) for(int i = (b) - 1; i >= (a); --i)
#define sz(a) (int)a.size()
#define de(x) cout << #x << " = " << x << endl
#define dd(x) cout << #x << " = " << x << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef double db;

const int N = 5050;

string s;
int g[N];
bool mex[N];

int main() {
	std::ios::sync_with_stdio(0);
	std::cin.tie(0);
	cin >> s;
	rep(i, 0, N) {
		memset(mex, 0, sizeof(mex));
		rep(j, 0, i) {
			int l = max(0, j - 1), r = max(0, i - j - 2);
			mex[g[l] ^ g[r]] = 1;
		}
		rep(j, 0, N) if(!mex[j]) {
			g[i] = j;
			break;
		}
	}
	int ans = 0;
	for(int i = 1, j; i < sz(s) - 1; ++i) if(s[i - 1] == s[i + 1]) {
		j = i;
		while(s[j - 1] == s[j + 1]) ++j;
		--j;
		ans ^= g[j - i + 1];
		i = j;
	}
	if(ans) {
		cout << "First" << endl;
		for(int i = 1, j; i < sz(s) - 1; ++i) if(s[i - 1] == s[i + 1]) {
			j = i;
			while(s[j - 1] == s[j + 1]) ++j;
			--j;
			rep(t, 0, j - i + 1) {
				int l = max(0, t - 1), r = max(0, j - i + 1 - t - 2);
				if((ans ^ g[j - i + 1] ^ g[l] ^ g[r]) == 0) {
					cout << i + t + 1 << endl;
					return 0;
				}
			}
			i = j;
		}
	} else {
		cout << "Second" << endl;
	}
	return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
#define maxn 5005
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;

int a[maxn];

int n;

int sg[maxn];

bool bz[maxn];

int getsg(int x,int y){
	int ret=0;
	int l=x+1,r;
	while (l<=y-1) {
		if(a[l-1]!=a[l+1]) {
			l++;
			continue;
		}
		r=l;
		while (r<y-1 && a[r]==a[r+2]) r++;
		ret^=sg[r-l+1];
		l=r+1;
	}
	return ret;
}

int main(){
	char c=getchar();
	while (c>='a' && c<='z') {
		a[++n]=c-'a'+1;
		c=getchar();
	}
	sg[0]=0;
	sg[1]=1;
	fo(i,2,n) {
		mem(bz,0);
		fo(j,1,i) {
			int l=max(0,i-2),r=max(0,n-i-1);
			bz[sg[l] ^ sg[r]]=1;
		}
		while (bz[sg[i]]) sg[i]++;
	}
	if (getsg(1,n)==0) {
		puts("Second");
		return 0;
	}
	fo(i,2,n) {
		if (a[i-1]!=a[i+1]) continue;
		if ((getsg(1,i-1) ^ getsg(i+1,n))==0){
			puts("First");
			printf("%d",i);
			return 0;
		}
	}
	return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
#define maxn 5005
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;

int a[maxn];

int n;

int sg[maxn];

bool bz[maxn];

int getsg(int x,int y){
	int ret=0;
	int l=x+1,r;
	while (l<=y-1) {
		if(a[l-1]!=a[l+1]) {
			l++;
			continue;
		}
		r=l;
		while (r<y-1 && a[r]==a[r+2]) r++;
		ret^=sg[r-l+1];
		l=r+1;
	}
	return ret;
}

int main(){
	char c=getchar();
	while (c>='a' && c<='z') {
		a[++n]=c-'a'+1;
		c=getchar();
	}
	sg[0]=0;
	sg[1]=1;
	fo(i,2,n) {
		mem(bz,0);
		fo(j,1,i) {
			int l=max(0,j-2),r=max(0,i-j-1);
			bz[sg[l] ^ sg[r]]=1;
		}
		while (bz[sg[i]]) sg[i]++;
	}
	if (getsg(1,n)==0) {
		puts("Second");
		return 0;
	}
	fo(i,2,n) {
		if (a[i-1]!=a[i+1]) continue;
		if ((getsg(1,i-1) ^ getsg(i+1,n))==0){
			puts("First");
			printf("%d",i);
			return 0;
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <set>

using namespace std;

struct prze
{
    int l, p;
};

int mex(set<int>& a)
{
    for (int i = 0; true; ++i)
    {
        if (a.size() == 0)
            return i;
        if (i != *a.begin())
            return i;
        else
            a.erase(a.begin());
    }
}

int main()
{
    ios_base::sync_with_stdio(0);
    string s;
    cin >> s;
    int n = s.size();
    vector<int> f(5000);
    f[0] = 0;
    for (int i = 1; i < 5000; ++i)
    {
        set<int> zb;
        for (int j = 1; j <= i; ++j)
            zb.insert(f[max(0, j - 2)] ^ f[max(0, i - j - 1)]);
        f[i] = mex(zb);
    }
    vector<prze> P;
    for (int i = 1; i < n - 1; )
    {
        if (s[i - 1] == s[i + 1])
        {
            int l = i, p = i;
            while (p + 2 < n && s[p] == s[p + 2])
                ++p;
            P.push_back({l, p});
            i = p + 1;
        }
        else
            ++i;
    }
    int odp = 0;
    for (int i = 0; i < P.size(); ++i)
        odp ^= f[P[i].p - P[i].l + 1];
    if (odp != 0)
    {
        cout << "First" << endl;
        for (int i = 0; i < P.size(); ++i)
        {
            int dl = P[i].p - P[i].l + 1;
            for (int j = 1; j <= dl; ++j)
            {
                odp ^= f[dl];
                odp ^= (f[max(0, j - 2)] ^ f[max(0, dl - j - 1)]);
                if (odp == 0)
                {
                    cout << P[i].l + (j - 1) + 1;
                    return 0;
                }
                odp ^= (f[max(0, j - 2)] ^ f[max(0, dl - j - 1)]);
                odp ^= f[dl];
            }
        }
    }
    cout << "Second";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll int
#define N ((ll)5010)
#define MOD ((ll)1e9+7)
ll tavan(ll x,ll y){ll res=1;while(y){res*=y%2?x:1;res%=MOD;x*=x;x%=MOD;y/=2;}return res;}

string s;
ll dp[N],id[N],ans;
vector <pair<ll,ll> > v;

int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>s;
	for(int i=1;i<N;i++)
	{
		set <ll> s;
		for(int j=1;j<=i;j++)
			s.insert((dp[max(0,j-2)]^dp[max(0,i-j-1)]));
		for(int j=0;;j++)
			if(!s.count(j))
			{
				dp[i]=j;
				break;
			}
	}
	for(int i=0,now=0;i<s.size();i++)
	{
		if(i==0 || i==(ll)s.size()-1 || s[i-1]!=s[i+1])
		{
			if(!now)continue;
			ans^=dp[now];
			v.push_back({i-now,now});
			now=0;
		}
		else now++;
	}
	if(!ans)return cout<<"Second",0;
	ll res=-1;
	for(auto u:v)
	{
		for(int i=1;i<=u.second;i++)
			if((dp[max(0,i-2)]^dp[max(0,u.second-i-1)]^dp[u.second]^ans)==0)
			{
				res=u.first+i;
				break;
			}
		if(res!=-1)break;
	}
	cout<<"First\n"<<res;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll int
#define N ((ll)5010)
#define MOD ((ll)1e9+7)
ll tavan(ll x,ll y){ll res=1;while(y){res*=y%2?x:1;res%=MOD;x*=x;x%=MOD;y/=2;}return res;}

string s;
bool dp[N],ans;
ll id[N],ans_id=-1;

int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>s;
	for(int i=1;i<N;i++)
	{
		for(int j=1;j<=i;j++)
			if((dp[max(0,j-2)]^dp[max(0,i-j-1)])==0)
			{
				dp[i]=1;id[i]=j;
				break;
			}
	}
	for(int i=0,now=0;i<s.size();i++)
	{
		if(i==0 || i==(ll)s.size()-1 || s[i-1]!=s[i+1])
		{
			if(!now)continue;
			ans^=dp[now];
			if(ans_id==-1 && dp[now])ans_id=(i-now+id[now]);
			else if(ans_id==-1)ans_id=(i-now+1);
			now=0;
		}
		else now++;
	}
	if(ans)cout<<"First\n"<<ans_id;
	else cout<<"Second";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll int
#define N ((ll)5010)
#define MOD ((ll)1e9+7)
ll tavan(ll x,ll y){ll res=1;while(y){res*=y%2?x:1;res%=MOD;x*=x;x%=MOD;y/=2;}return res;}

string s;
bool dp[N],ans;
ll id[N],ans_id=-1;

int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>s;
	for(int i=1;i<N;i++)
	{
		for(int j=1;j<=i;j++)
			if((dp[max(0,j-2)]^dp[max(0,i-j-1)])==0)
			{
				dp[i]=1;id[i]=j;
				break;
			}
	}
	for(int i=0,now=0;i<s.size();i++)
	{
		if(i==0 || i==(ll)s.size()-1 || s[i-1]!=s[i+1])
		{
			ans^=dp[now];
			if(ans_id==-1 && dp[now])ans_id=(i-now+id[now]);
			else if(ans_id==-1)ans_id=(i-now+1);
			now=0;
		}
		else now++;
	}
	if(ans)cout<<"First\n"<<ans_id;
	else cout<<"Second";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll int
#define N ((ll)5010)
#define MOD ((ll)1e9+7)
ll tavan(ll x,ll y){ll res=1;while(y){res*=y%2?x:1;res%=MOD;x*=x;x%=MOD;y/=2;}return res;}

string s;
bool dp[N],ans;
ll id[N],ans_id=-1;

int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>s;
	for(int i=1;i<N;i++)
	{
		for(int j=1;j<=i;j++)
			if(dp[max(0,j-2)]^dp[max(0,i-j-1)]==0)
			{
				dp[i]=1;id[i]=j;
				break;
			}
	}
	for(int i=0,now=0;i<s.size();i++)
	{
		if(i==0 || i==(ll)s.size()-1 || s[i-1]!=s[i+1])
		{
			ans^=dp[now];
			if(ans_id==-1 && now)ans_id=(i-now+id[now]);
			now=0;
		}
		else now++;
	}
	if(ans)cout<<"First\n"<<ans_id;
	else cout<<"Second";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll int
#define N ((ll)5010)
#define MOD ((ll)1e9+7)
ll tavan(ll x,ll y){ll res=1;while(y){res*=y%2?x:1;res%=MOD;x*=x;x%=MOD;y/=2;}return res;}

string s;
ll dp[N],id[N],ans;
vector <pair<ll,ll> > v;

int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>s;
	for(int i=1;i<N;i++)
	{
		set <ll> s;
		for(int j=1;j<=i;j++)
			s.insert((dp[max(0,j-2)]^dp[max(0,i-j-1)]));
		for(int j=0;;j++)
			if(!s.count(j))
			{
				dp[i]=j;
				break;
			}
	}
	for(int i=0,now=0;i<s.size();i++)
	{
		if(i==0 || i==(ll)s.size()-1 || s[i-1]!=s[i+1])
		{
			if(!now)continue;
			ans^=dp[now];
			v.push_back({i-now,now});
			now=0;
		}
		else now++;
	}
	if(!ans)return cout<<"Second",0;
	ll res=-1;
	for(auto u:v)
	{
		for(int i=1;i<=u.second;i++)
			if((dp[max(0,i-2)]^dp[max(0,u.second-i-1)^dp[u.second]^ans])==0)
			{
				res=u.first+i;
				break;
			}
		if(res!=-1)break;
	}
	cout<<"First\n"<<res;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define vp  vector<pii>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ls l,mid,rt<<1
#define rs mid+1,r,rt<<1|1
#define de(x) cout<< #x<<" = "<<x<<endl
#define dd(x) cout<< #x<<" = "<<x<<" "
#define sf scanf
#define pf printf
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
typedef long long ll;
typedef unsigned long long ull;
//typedef __int128 INT128;
//INT128 read(){
//    INT128 x=0,f=1;
//    char ch=getchar();
//    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
//    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
//    return x*f;
//}
//void write(INT128 x){
//    if(x<0){putchar('-');x=-x;}
//    if(x<10){putchar(x+'0'); return;}
//    write(x/10);putchar(x%10+'0');
//}
typedef long double ld;
const int INF=0x3f3f3f3f;
const double eps=1e-8;
const double PI=acos(-1.0);
const int MAXN=1e5+5;
const int MAXM=2e6+5;
const int MOD=1e9+7;
int sgn(double x){if(fabs(x)<eps)return 0;if(x<0)return -1;else return 1;}
ll pw(ll a,ll n,ll mod){ll ret=1;while(n){if(n&1)ret=ret*a%mod;a=a*a%mod;n>>=1;}return ret;}
ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
void inc(ll &a,ll b){a+=b;if(a>=MOD)a-=MOD;}
void dec(ll &a,ll b){a-=b;if(a<0)a+=MOD;}
int mul(int a, int b){ll c=1ll*a*b;return c-c/MOD*MOD;}
//std::ios::sync_with_stdio(false);
//head

const int MAX=5000;
int sg[5005],bad[5005];
char t[5005];

void init(){
	rep(i,1,MAX+1){
		rep(j,1,i+1){
			bad[sg[max(j-2,0)]^sg[max(i-j-1,0)]]=i;
		}
		int tmp=0; while(bad[tmp]==i)tmp++; sg[i]=tmp;
	}
}

int getSG(int l,int r){
	int ret=0,tmp=0;
	rep(i,l+1,r){
		if(t[i-1]==t[i+1])tmp++;
		else ret^=sg[tmp],tmp=0;
	}
	return ret^sg[tmp];
}

int main(){
	init(); sf("%s",t+1); int n=strlen(t+1);
	rep(i,2,n){
		if(t[i-1]==t[i+1]&&(getSG(1,i-1)^getSG(i+1,n))==0){
			pf("First\n%d\n",i); return 0;
		}
	}
	puts("Second");
}


#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define vp  vector<pii>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ls l,mid,rt<<1
#define rs mid+1,r,rt<<1|1
#define de(x) cout<< #x<<" = "<<x<<endl
#define dd(x) cout<< #x<<" = "<<x<<" "
#define sf scanf
#define pf printf
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
typedef long long ll;
typedef unsigned long long ull;
//typedef __int128 INT128;
//INT128 read(){
//    INT128 x=0,f=1;
//    char ch=getchar();
//    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
//    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
//    return x*f;
//}
//void write(INT128 x){
//    if(x<0){putchar('-');x=-x;}
//    if(x<10){putchar(x+'0'); return;}
//    write(x/10);putchar(x%10+'0');
//}
typedef long double ld;
const int INF=0x3f3f3f3f;
const double eps=1e-8;
const double PI=acos(-1.0);
const int MAXN=1e5+5;
const int MAXM=2e6+5;
const int MOD=1e9+7;
int sgn(double x){if(fabs(x)<eps)return 0;if(x<0)return -1;else return 1;}
ll pw(ll a,ll n,ll mod){ll ret=1;while(n){if(n&1)ret=ret*a%mod;a=a*a%mod;n>>=1;}return ret;}
ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
void inc(ll &a,ll b){a+=b;if(a>=MOD)a-=MOD;}
void dec(ll &a,ll b){a-=b;if(a<0)a+=MOD;}
int mul(int a, int b){ll c=1ll*a*b;return c-c/MOD*MOD;}
//std::ios::sync_with_stdio(false);
//head

const int MAX=5000;
int sg[5005],bad[5005];
char t[5005];

void init(){
	rep(i,1,MAX+1){
		rep(j,1,i+1){
			bad[sg[max(j-2,0)]^sg[max(i-j-1,0)]]=i;
		}
		int tmp=0; while(bad[tmp]==i)tmp++; sg[i]=tmp;
	}
}

int getSG(int l,int r){
	int ret=0,tmp=0;
	rep(i,l+1,r){
		if(t[i-1]==t[i+1])tmp++;
		else ret^=sg[tmp],tmp=0;
	}
	return ret^sg[tmp];
}

int main(){
	init(); sf("%s",t+1); int n=strlen(t+1);
	rep(i,2,n){
		if((t[i-1]==t[i+1])&&(getSG(1,i-1)^getSG(i+1,n)==0)){
			pf("First\n%d\n",i); return 0;
		}
	}
	puts("Second");
}


#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define vp  vector<pii>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ls l,mid,rt<<1
#define rs mid+1,r,rt<<1|1
#define de(x) cout<< #x<<" = "<<x<<endl
#define dd(x) cout<< #x<<" = "<<x<<" "
#define sf scanf
#define pf printf
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
typedef long long ll;
typedef unsigned long long ull;
//typedef __int128 INT128;
//INT128 read(){
//    INT128 x=0,f=1;
//    char ch=getchar();
//    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
//    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
//    return x*f;
//}
//void write(INT128 x){
//    if(x<0){putchar('-');x=-x;}
//    if(x<10){putchar(x+'0'); return;}
//    write(x/10);putchar(x%10+'0');
//}
typedef long double ld;
const int INF=0x3f3f3f3f;
const double eps=1e-8;
const double PI=acos(-1.0);
const int MAXN=1e5+5;
const int MAXM=2e6+5;
const int MOD=1e9+7;
int sgn(double x){if(fabs(x)<eps)return 0;if(x<0)return -1;else return 1;}
ll pw(ll a,ll n,ll mod){ll ret=1;while(n){if(n&1)ret=ret*a%mod;a=a*a%mod;n>>=1;}return ret;}
ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
void inc(ll &a,ll b){a+=b;if(a>=MOD)a-=MOD;}
void dec(ll &a,ll b){a-=b;if(a<0)a+=MOD;}
int mul(int a, int b){ll c=1ll*a*b;return c-c/MOD*MOD;}
//std::ios::sync_with_stdio(false);
//head

const int MAX=5000;
int sg[5005],bad[5005];
char t[5005];

void init(){
	rep(i,1,MAX+1){
		rep(j,1,i-1){
			bad[sg[max(j-2,0)]^sg[max(i-j-1,0)]]=i;
		}
		int tmp=0; while(bad[tmp]==i)tmp++; sg[i]=tmp;
	}
}

int getSG(int l,int r){
	int ret=0,tmp;
	rep(i,l+1,r){
		tmp=0; while(t[i-1]==t[i+1]&&i+1<r)i++,tmp++;
		ret^=sg[tmp];
	}
	return ret;
}

int main(){
	init(); sf("%s",t+1); int n=strlen(t+1);
	rep(i,2,n){
		if((t[i-1]==t[i+1])&&(getSG(1,i-1)^getSG(i+1,n)==0)){
			pf("First\n%d\n",i); return 0;
		}
	}
	puts("Second");
}


#include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define fi first
#define se second
typedef long long ll;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rnf(2106);
const int N = 5003;

int n;
char a[N];

int dp[N];
bool c[N];

void solv()
{
    scanf(" %s", (a + 1));
    for (n = 1; a[n]; ++n){}
    --n;
    dp[0] = 0;
    for (int i = 1; i <= n; ++i)
    {
        memset(c, false, sizeof c);
        for (int j = 1; j <= i; ++j)
        {
            int u = (dp[max(0, j - 2)] ^ dp[max(0, i - j - 1)]);
            if (u < N)
                c[u] = true;
        }
        for (int j = 0; ; ++j)
        {
            if (!c[j])
            {
                dp[i] = j;
                break;
            }
        }
    }
    int ans = 0;
    vector<int> v;
    vector<vector<int> > vv;
    for (int i = 1; i <= n; ++i)
    {
        if (i > 1 && i < n && a[i - 1] == a[i + 1])
        {
            v.push_back(i);
        }
        else
        {
            vv.push_back(v);
            ans ^= dp[v.size()];
            v.clear();
        }
    }
    if (ans)
    {
        printf("First\n");
        for (int i = 0; i < vv.size(); ++i)
        {
            ans ^= dp[vv[i].size()];
            for (int j = 1; j <= vv[i].size(); ++j)
            {
                if ((ans ^ dp[max(0, sz(vv[i]) - j - 1)] ^ dp[max(0, j - 2)]) == 0)
                {
                    printf("%d\n", vv[i][j - 1]);
                    return;
                }
            }
            ans ^= dp[vv[i].size()];
        }
    }
    else
        printf("Second\n");
}

int main()
{
    #ifdef SOMETHING
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif // SOMETHING
    solv();
    return 0;
}

//while ((double)clock() / CLOCKS_PER_SEC <= 0.9){}


#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
#define in(n) int n;cin>>n;
#define inl(n) long int n;cin>>n;
#define ins(s) string s; getline(cin,s);
#define forn(i,n) for(int i=0;i<n;i++)
int main(){
    in(n);
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    long long int c=0;
    sort(a,a+n);
    for(int i=0;i<n;i++){
        c+= abs(i+1-a[i]);
    }
    cout<<c;

}


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

using namespace std;
typedef long long lld;

int main()
{
    int n;
    lld ans=0;
    scanf("%d",&n);
    int arr[n];
    for(int i=1;i<=n;i++){
        scanf("%d",&arr[i]);
    }
    sort(arr,arr+n);
    for(int i=1;i<=n;i++){
        ans+=abs(i-arr[i]);
    }
    printf("%lld",ans);

    return 0;
}


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

using namespace std;
typedef long long lld;

int main()
{
    int n,N=3000000+ 5;
    lld ans=0;
    scanf("%d",&n);
    bool ok[N]={0};
    int arr[n];
    for(int i=0;i<n;i++){
        scanf("%d",&arr[i]);
        ok[arr[i]]=1;
    }
    sort(arr,arr+n);
    int l=0;
    for(int i=1;i<=n;i++){
        if(!ok[i]){
            ans+=abs((-1)*arr[l]+i);
            l++;
        }
    }
    printf("%lld",ans);

    return 0;
}


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

using namespace std;
typedef long long lld;

int main()
{
    int n,arr[300005];
    scanf("%d",&n);
    for (int i = 0; i < n; i++){
        scanf("%d", &arr[i]);
    }
    sort(arr, arr+ n);
    lld ans=0;
    for (int i = 0; i < n; i++)
    {
        ans += abs(i + 1 - arr[i]);
    }
    printf("%lld", ans);

    return 0;
}


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

using namespace std;
typedef long long lld;

int main()
{
    int n,N=3000000+ 5,ans=0;
    scanf("%d",&n);
    bool ok[N]={0};
    int arr[n];
    for(int i=0;i<n;i++){
        scanf("%d",&arr[i]);
        ok[arr[i]]=1;
    }
    sort(arr,arr+n);
    int l=0;
    for(int i=1;i<=n;i++){
        if(!ok[i]){
            ans+=abs((-1)*arr[l]+i);
            l++;
        }
    }
    printf("%d",ans);

    return 0;
}


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

using namespace std;
typedef long long lld;

int main()
{
    int n,N=3e5+ 5,ans=0;
    scanf("%d",&n);
    bool ok[N]={0};
    int arr[n];
    for(int i=0;i<n;i++){
        scanf("%d",&arr[i]);
        ok[arr[i]]=1;
    }
    sort(arr,arr+n);
    int l=0;
    for(int i=1;i<=n;i++){
        if(!ok[i]){
            ans+=abs((-1)*arr[l]+i);
            l++;
        }
    }
    printf("%d",ans);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
void fast()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

int32_t main()
{
	fast();
	int n;	cin>>n;
	int arr[n];
	vector<bool> mark(n+1,false);
	for(int i=0;i<n;i++)
	{
		cin>>arr[i];
		if(arr[i]>=1 and arr[i]<=n)	mark[arr[i]]=true;
	}
	sort(arr,arr+n);
	int index=1;
	int ans=0;
	for(int i=0;i<n;i++)
	{
		while(mark[index] and index<=n)	index++;
		if(arr[i]<1 or arr[i]>n)
		{
			//cout<<arr[i]<<" "<<index<<"\n";
			ans+=abs(arr[i]-index);
			mark[index]=true;
		}
	}
	cout<<ans<<"\n";
	return 0;
}


#include <bits/stdc++.h>
#define int long long int
using namespace std;
int32_t main()
{
	int n;	cin>>n;
	vector<int> v(n);
	int ans=0;
	for(int i=0;i<n;i++)
		cin>>v[i];
	sort(v.begin(),v.end());
	for(int i=0;i<n;i++)
	{
		ans+=abs(v[i]-i-1);
	}
	cout<<ans<<"\n";
	return 0;
}


#include <bits/stdc++.h>
#define int long long int
using namespace std;
int32_t main()
{
	int n;	cin>>n;
	vector<int> v(n);
	int ans=0;
	for(int i=0;i<n;i++)
	{
		cin>>v[i];
		ans+=abs(v[i]-i-1);
	}
	cout<<ans<<"\n";
	return 0;
}


#include <bits/stdc++.h>
#define int long long int
using namespace std;
int32_t main()
{
	int n;	cin>>n;
	vector<int> v1,v2;
	vector<bool> mark(n+1,0);
	for(int i=0;i<n;i++)
	{
		int t;	cin>>t;
		if(t<1 or t>n) v1.push_back(t);
		if(t>=1 and t<=n) mark[t]=true;
	}
	sort(v1.begin(),v1.end());
	for(int i=1;i<=n;i++)
	{
		if(!mark[i]) v2.push_back(i);
	}
	int ans=0;
	//if(v1.size()==v2.size())	cout<<"hell yeahhh\n";
	for(int i=0;i<v1.size();i++)
	{
		//cout<<v1[i]<<" "<<v2[i]<<"\n";
		ans+=abs(v1[i]-v2[i]);
	}
	cout<<ans<<"\n";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main()
{
    int n;  cin>>n;
    vector<int> v(n);
    for(int i=0;i<n;i++)    cin>>v[i];
    sort(v.begin(),v.end());
    int ans=0;
    for(int i=0;i<n;i++)
    {
        ans+=abs(i+1-v[i]);
    }
    cout<<ans<<"\n";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

struct node{
    int value;
    struct node *rchild;
    struct node *lchild;
};
struct node *root = NULL;

void insert(int data){
    struct node *temp = new struct node();;
    temp->value = data;
    temp->lchild = NULL;
    temp->rchild = NULL;

    if(root == NULL){
       root = temp;
    }
    else{
       node *current = root, *parent;
       while(true){
         parent = current;
         if(data > current->value){
            current = current->rchild;
            if(current == NULL){
               parent->rchild = temp;
               break;
            }
         }
         else{
            current = current->lchild;
            if(current == NULL){
               parent->lchild = temp;
               break;
            }
         }
       }
    }
}

bool search(int data){
    struct node *temp = root;
    while(true){
        if(temp == NULL){
           return false;
        }
        else{
           if(data>temp->value){
              temp = temp->rchild;
           }
           else if(data<temp->value){
              temp = temp->lchild;
           }
           else{
              return true;
           }
        }
    }
}
int main() {
    int n;
    cin>>n;
    int array[n];
    for(int i=0;i<n;i++){
        cin>>array[i];
        insert(array[i]);
    }
    int initial = 0, t, x;
    long int moves = 0;
    bool flag, flag1;
    for(int i=0;i<n;i++){
        if(array[i]<=0){
           t = initial + 1;
           while(true){
               flag = search(t);
               if(flag == false){
                  moves = moves+(t-array[i]);
                  insert(t);
                  break;
               }
               t++;
           }
           initial = t;
        }
        else if(array[i]>n){
            x = array[i] - 1;
            while(true){
                flag1 = search(x);
                if(flag1 == false){
                   moves = moves+(array[i]-x);
                   insert(x);
                   break;
                }
                x--;
            }
        }
        else{}
    }
    cout<<moves;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin>>n;
    int array[n], a_array[n+1];
    for(int i=0;i<n;i++){
        cin>>array[i];
        a_array[i] = 0;
    }
    a_array[n] = 0;
    for(int i=0;i<n;i++){
        if(array[i]>0 && array[i]<n+1)
           a_array[array[i]]++;
    }
    int initial = 0, x, z = 0;
    long long int moves = 0, t;
    for(int i=0;i<n;i++){
        if(array[i]<=0){
           t = initial + 1;
           while(true){
               if(a_array[t] == 0){
                  a_array[t]++;
                  moves = moves+(t-array[i]);
                  break;
               }
               t++;
           }
           initial = t;
        }
        else if(array[i]>n){
            x = n - z;
            while(true){
                z++;
                if(a_array[x] == 0){
                   a_array[x]++;
                   moves = moves+(array[i]-x);
                   break;
                }
                x--;
            }
        }
        else{}
    }
    cout<<moves;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin>>n;
    int array[n], a_array[n+1];
    for(int i=0;i<n;i++){
        cin>>array[i];
        a_array[i] = 0;
    }
    a_array[n] = 0;
    for(int i=0;i<n;i++){
        if(array[i]>0 && array[i]<n+1)
           a_array[array[i]]++;
    }
    int initial = 0, t, x, z = 0;
    long int moves = 0;
    for(int i=0;i<n;i++){
        if(array[i]<=0){
           t = initial + 1;
           while(true){
               if(a_array[t] == 0){
                  a_array[t]++;
                  moves = moves+(t-array[i]);
                  break;
               }
               t++;
           }
           initial = t;
        }
        else if(array[i]>n){
            x = n - z;
            while(true){
                z++;
                if(a_array[x] == 0){
                   a_array[x]++;
                   moves = moves+(array[i]-x);
                   break;
                }
                x--;
            }
        }
        else{}
    }
    cout<<moves;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin>>n;
    int array[n];
    for(int i=0;i<n;i++)
        cin>>array[i];
    sort(array,array+n);
    long long moves=0;
    for(int i=0;i<n;i++){
        moves+=abs(array[i]-i-1);
    }
    cout<<moves<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin>>n;
    int array[n], a_array[n+1];
    for(int i=0;i<n;i++){
        cin>>array[i];
        a_array[i] = 0;
    }
    a_array[n] = 0;
    for(int i=0;i<n;i++){
        if(array[i]>0 && array[i]<n+1)
           a_array[array[i]]++;
    }
    int initial = 0, x, z = 0;
    long int moves = 0, t;
    for(int i=0;i<n;i++){
        if(array[i]<=0){
           t = initial + 1;
           while(true){
               if(a_array[t] == 0){
                  a_array[t]++;
                  moves = moves+(t-array[i]);
                  break;
               }
               t++;
           }
           initial = t;
        }
        else if(array[i]>n){
            x = n - z;
            while(true){
                z++;
                if(a_array[x] == 0){
                   a_array[x]++;
                   moves = moves+(array[i]-x);
                   break;
                }
                x--;
            }
        }
        else{}
    }
    cout<<moves;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< pair<int,int> > vpii;
typedef vector< pair<ll,ll> > vpll;
typedef vector< vector<int> > matrix;

#define SET(Ar,val) memset(Ar,val,sizeof(Ar))
#define rep(i,val,n)  for(int i=val;i<n;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define LMAX LONG_LONG_MAX
#define LMIN LONG_LONG_MIN
#define IMAX INT_MAX
#define IMIN INT_MIN
#define M 1000000007
#define N 1<<17 + 5

/*--------------------------------------------------------------------------------------------------------------------------------*/

template <class T> T modpower(T a,T b,T MOD)
{
    T ans=1;
    while(b!=0)
    {
        if(b%2==1)
        ans=(ans*a)%MOD;
        a=(a*a)%MOD;
        b/=2;
    }
    return ans;
}

int c[300005];

void init()
{
    vi v1,v2;
    int n,x;
    cin >> n ;
    rep(i,0,n)
    {
        cin >> x;
        if(x<=0)
        v1.pb(x);
        else if(x>n)
        v2.pb(x);
        else if(c[x]==0)
        c[x]=1;
        else
        v2.pb(x);
    }
    sort(v1.begin(),v1.end());
    sort(v2.rbegin(),v2.rend());
    ll ans=0;
    rep(i,1,n+1)
    {
        /*for(auto it : v1)
        cout << it << " " ;
        cout << endl ;
        for(auto it : v2)
        cout << it << " " ;
        cout << endl ;*/
        if(c[i]==0)
        {
            if(v1.size()!=0)
            {
                //if(abs(v1.back()-i)<abs(v2.back()-i))
                {
                    ans+=abs(v1.back()-i);
                    v1.pop_back();
                }
                /*else
                {
                    ans+=abs(v2.back()-i);
                    v2.pop_back();
                }*/
            }
            else
            {
                //if(v1.size()==0)
                {
                    ans+=abs(v2.back()-i);
                    v2.pop_back();
                }
                /*else
                {
                    ans+=abs(v1.back()-i);
                    v1.pop_back();
                }*/
            }
        }
    }
    cout << ans ;
}

int main()
{
    clock_t time1 = clock();
	#ifndef ONLINE_JUDGE
	freopen("sa.txt","r",stdin);
	#else
	//ONLINE_JUDGE
	#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    init();
    clock_t time2 = clock();
    cerr <<"Time: " <<(double)(time2-time1)/CLOCKS_PER_SEC <<" seconds" <<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< pair<int,int> > vpii;
typedef vector< pair<ll,ll> > vpll;
typedef vector< vector<int> > matrix;

#define SET(Ar,val) memset(Ar,val,sizeof(Ar))
#define rep(i,val,n)  for(int i=val;i<n;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define LMAX LONG_LONG_MAX
#define LMIN LONG_LONG_MIN
#define IMAX INT_MAX
#define IMIN INT_MIN
#define M 1000000007
#define N 1<<17 + 5

/*--------------------------------------------------------------------------------------------------------------------------------*/

template <class T> T modpower(T a,T b,T MOD)
{
    T ans=1;
    while(b!=0)
    {
        if(b%2==1)
        ans=(ans*a)%MOD;
        a=(a*a)%MOD;
        b/=2;
    }
    return ans;
}

int c[300005];

void init()
{
    vi v1,v2;
    int n,x;
    cin >> n ;
    rep(i,0,n)
    {
        cin >> x;
        if(x<=0)
        v1.pb(x);
        else if(x>n)
        v2.pb(x);
        else if(c[x]==0)
        c[x]=1;
        else
        v2.pb(x);
    }
    sort(v1.begin(),v1.end());
    sort(v2.rbegin(),v2.rend());
    ll ans=0;
    rep(i,1,n+1)
    {
        for(auto it : v1)
        cout << it << " " ;
        cout << endl ;
        for(auto it : v2)
        cout << it << " " ;
        cout << endl ;
        if(c[i]==0)
        {
            if(v1.size() && v2.size())
            {
                if(abs(v1.back()-i)<abs(v2.back()-i))
                {
                    ans+=abs(v1.back()-i);
                    v1.pop_back();
                }
                else
                {
                    ans+=abs(v2.back()-i);
                    v2.pop_back();
                }
            }
            else
            {
                if(v1.size()==0)
                {
                    ans+=abs(v2.back()-i);
                    v2.pop_back();
                }
                else
                {
                    ans+=abs(v1.back()-i);
                    v1.pop_back();
                }
            }
        }
    }
    cout << ans ;
}

int main()
{
    clock_t time1 = clock();
	#ifndef ONLINE_JUDGE
	freopen("sa.txt","r",stdin);
	#else
	//ONLINE_JUDGE
	#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    init();
    clock_t time2 = clock();
    cerr <<"Time: " <<(double)(time2-time1)/CLOCKS_PER_SEC <<" seconds" <<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< pair<int,int> > vpii;
typedef vector< pair<ll,ll> > vpll;
typedef vector< vector<int> > matrix;

#define SET(Ar,val) memset(Ar,val,sizeof(Ar))
#define rep(i,val,n)  for(int i=val;i<n;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define LMAX LONG_LONG_MAX
#define LMIN LONG_LONG_MIN
#define IMAX INT_MAX
#define IMIN INT_MIN
#define M 1000000007
#define N 1<<17 + 5

/*--------------------------------------------------------------------------------------------------------------------------------*/

template <class T> T modpower(T a,T b,T MOD)
{
    T ans=1;
    while(b!=0)
    {
        if(b%2==1)
        ans=(ans*a)%MOD;
        a=(a*a)%MOD;
        b/=2;
    }
    return ans;
}

int c[300005];

void init()
{
    vi v1,v2;
    int n,x;
    cin >> n ;
    rep(i,0,n)
    {
        cin >> x;
        if(x<=0)
        v1.pb(x);
        else if(x>n)
        v2.pb(x);
        else if(c[x]==0)
        c[x]=1;
        else
        v2.pb(x);
    }
    sort(v1.begin(),v1.end());
    sort(v2.rbegin(),v2.rend());
    ll ans=0;
    rep(i,1,n+1)
    {
        /*for(auto it : v1)
        cout << it << " " ;
        cout << endl ;
        for(auto it : v2)
        cout << it << " " ;
        cout << endl ;*/
        if(c[i]==0)
        {
            if(v1.size() && v2.size())
            {
                if(abs(v1.back()-i)<abs(v2.back()-i))
                {
                    ans+=abs(v1.back()-i);
                    v1.pop_back();
                }
                else
                {
                    ans+=abs(v2.back()-i);
                    v2.pop_back();
                }
            }
            else
            {
                if(v1.size()==0)
                {
                    ans+=abs(v2.back()-i);
                    v2.pop_back();
                }
                else
                {
                    ans+=abs(v1.back()-i);
                    v1.pop_back();
                }
            }
        }
    }
    cout << ans ;
}

int main()
{
    clock_t time1 = clock();
	#ifndef ONLINE_JUDGE
	freopen("sa.txt","r",stdin);
	#else
	//ONLINE_JUDGE
	#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    init();
    clock_t time2 = clock();
    cerr <<"Time: " <<(double)(time2-time1)/CLOCKS_PER_SEC <<" seconds" <<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< pair<int,int> > vpii;
typedef vector< pair<ll,ll> > vpll;
typedef vector< vector<int> > matrix;

#define SET(Ar,val) memset(Ar,val,sizeof(Ar))
#define rep(i,val,n)  for(int i=val;i<n;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define LMAX LONG_LONG_MAX
#define LMIN LONG_LONG_MIN
#define IMAX INT_MAX
#define IMIN INT_MIN
#define M 1000000007
#define N 1<<17 + 5

/*--------------------------------------------------------------------------------------------------------------------------------*/

template <class T> T modpower(T a,T b,T MOD)
{
    T ans=1;
    while(b!=0)
    {
        if(b%2==1)
        ans=(ans*a)%MOD;
        a=(a*a)%MOD;
        b/=2;
    }
    return ans;
}

int c[300005];

void init()
{
    vi v1,v2;
    int n,x;
    cin >> n ;
    rep(i,0,n)
    {
        cin >> x;
        if(x<=0)
        v1.pb(x);
        else if(x>n)
        v2.pb(x);
        else
        c[x]=1;
    }
    sort(v1.begin(),v1.end());
    sort(v2.rbegin(),v2.rend());
    ll ans=0;
    rep(i,1,n+1)
    {
        if(c[i]==0)
        {
            if(v1.size() && v2.size())
            {
                if(abs(v1.back()-i)<abs(v2.back()-i))
                {
                    ans+=abs(v1.back()-i);
                    v1.pop_back();
                }
                else
                {
                    ans+=abs(v2.back()-i);
                    v2.pop_back();
                }
            }
            else
            {
                if(v1.size()==0)
                {
                    ans+=abs(v2.back()-i);
                    v2.pop_back();
                }
                else
                {
                    ans+=abs(v1.back()-i);
                    v1.pop_back();
                }
            }
        }
    }
    cout << ans ;
}

int main()
{
    clock_t time1 = clock();
	#ifndef ONLINE_JUDGE
	//freopen("sa.txt","r",stdin);
	#else
	//ONLINE_JUDGE
	#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    init();
    clock_t time2 = clock();
    cerr <<"Time: " <<(double)(time2-time1)/CLOCKS_PER_SEC <<" seconds" <<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< pair<int,int> > vpii;
typedef vector< pair<ll,ll> > vpll;
typedef vector< vector<int> > matrix;

#define SET(Ar,val) memset(Ar,val,sizeof(Ar))
#define rep(i,val,n)  for(int i=val;i<n;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define LMAX LONG_LONG_MAX
#define LMIN LONG_LONG_MIN
#define IMAX INT_MAX
#define IMIN INT_MIN
#define M 1000000007
#define N 1<<17 + 5

/*-------------------------------------------------------------------------------------------------------------------------------*/

template <class T> T modpower(T a,T b,T MOD)
{
    T ans=1;
    while(b!=0)
    {
        if(b%2==1)
        ans=(ans*a)%MOD;
        a=(a*a)%MOD;
        b/=2;
    }
    return ans;
}

int c[300005];

void init()
{
    vi v1,v2;
    int n,x;
    cin >> n ;
    rep(i,0,n)
    {
        cin >> x;
        if(x<=0)
        v1.pb(x);
        else if(x>n)
        v2.pb(x);
        else if(c[x]==0)
        c[x]=1;
        else
        v2.pb(x);
    }
    sort(v1.begin(),v1.end());
    sort(v2.rbegin(),v2.rend());
    ll ans=0;
    rep(i,1,n+1)
    {
        /*for(auto it : v1)
        cout << it << " " ;
        cout << endl ;
        for(auto it : v2)
        cout << it << " " ;
        cout << endl ;*/
        if(c[i]==0)
        {
            if(v1.size()!=0)
            {
                //if(abs(v1.back()-i)<abs(v2.back()-i))
                {
                    ans+=abs(v1.back()-i);
                    v1.pop_back();
                }
                /*else
                {
                    ans+=abs(v2.back()-i);
                    v2.pop_back();
                }*/
            }
            else
            {
                //if(v1.size()==0)
                {
                    ans+=abs(v2.back()-i);
                    v2.pop_back();
                }
                /*else
                {
                    ans+=abs(v1.back()-i);
                    v1.pop_back();
                }*/
            }
        }
    }
    cout << ans ;
}

int main()
{
    clock_t time1 = clock();
	#ifndef ONLINE_JUDGE
	freopen("sa.txt","r",stdin);
	#else
	//ONLINE_JUDGE
	#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    init();
    clock_t time2 = clock();
    cerr <<"Time: " <<(double)(time2-time1)/CLOCKS_PER_SEC <<" seconds" <<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n;
    cin>>n;
    long long int a[n],b[n+1]={};
    for(long long int i=0;i<n;i++)
    {
        cin>>a[i];
        b[a[i]]++;
    }
    sort(a,a+n);
    long long int x=1,count=0;
    for(long long int i=0;i<n;i++)
    {
        if(a[i]<1||a[i]>n)
        {
            while(1)
            {
                if(b[x]!=0)
                    x++;
                else
                    break;
            }
            count+=abs(a[i]-x);
            x++;
        }
    }
    cout<<count;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n;
    cin>>n;
    long long int a[n],b[n+1]={};
    for(long long int i=0;i<n;i++)
    {
        cin>>a[i];
       // b[a[i]]++;
    }
    sort(a,a+n);
    long long int sum=0;
    for (int i = 0; i < n; i++)
	{
		sum += abs(a[i] - (i + 1));
		//cout << sum << "\n";
	}
	cout << sum;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n;
    cin>>n;
    long long int a[n],b[n+1]={};
    for(long long int i=0;i<n;i++)
    {
        cin>>a[i];
        b[a[i]]++;
    }
    sort(a,a+n);
    long long int x=1,count=0;
    for(long long int i=0;i<n;i++)
    {
        if(b[a[i]]!=1)
        {
            while(1)
            {
                if(b[x]>0)
                    x++;
                else
                    break;
            }
            count+=abs(a[i]-x);
            b[a[i]]--;
            x++;
        }
    }
    cout<<count;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n;
    cin>>n;
    long long int a[n],b[n+1]={};
    for(long long int i=0;i<n;i++)
    {
        cin>>a[i];
        b[a[i]]++;
    }
    sort(a,a+n);
    long long int x=1,count=0;
    for(long long int i=0;i<n;i++)
    {
        //cout<<b[a[i]]<<endl;
        if((a[i]==0)||b[a[i]]!=1)
        {
            while(x<=n)
            {
                if(b[x]>0)
                    x++;
                else
                    break;
            }
           // cout<<abs(x)<<endl;
            count+=abs(a[i]-x);
            b[a[i]]--;
            x++;
        }
    }
    cout<<count;
}


#include <algorithm>
#include <iostream>
#include <vector>

int main()
{
	size_t n;
	std::cin >> n;

	uint64_t count = 0;

	int64_t sum = 0;
	for (size_t i = 0; i < n; ++i) {
		int a;
		std::cin >> a;

		if (a < 1) {
			count += 1 - a;
			sum += 1;
		} else if (a > n) {
			count += a - n;
			sum += n;
		} else {
			sum += a;
		}
	}

	count += int64_t(n * (1 + n) / 2) - sum;
	std::cout << count << '\n';

	return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

int main()
{
	size_t n;
	std::cin >> n;

	std::vector<int> a(n);
	for (int& ai : a)
		std::cin >> ai;

	std::sort(a.begin(), a.end());

	uint64_t count = 0;
	for (size_t i = 0; i < n; ++i) {
		if (a[i] == i + 1)
			continue;

		count += abs(i + 1 - a[i]);
	}

	std::cout << count << '\n';

	return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

int main()
{
	size_t n;
	std::cin >> n;

	int64_t count = 0;

	int sum = 0;
	for (size_t i = 0; i < n; ++i) {
		int a;
		std::cin >> a;

		if (a < 1) {
			count += 1 - a;
			a = 1;
		} else if (a > n) {
			count += a - n;
			a = n;
		}
		sum += a;
	}

	count += abs(int(n * (1 + n) / 2) - sum);
	std::cout << count << '\n';

	return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

int main()
{
	int64_t n;
	std::cin >> n;

	int64_t count = 0;

	int64_t sum = 0;
	for (size_t i = 0; i < n; ++i) {
		int a;
		std::cin >> a;

		if (a < 1) {
			count += 1 - a;
			a = 1;
		} else if (a > n) {
			count += a - n;
			a = n;
		}
		sum += a;
	}

	count += abs(n * (1 + n) / 2 - sum);
	std::cout << count << '\n';

	return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

int main()
{
	size_t n;
	std::cin >> n;

	int64_t count = 0;

	int64_t sum = 0;
	for (size_t i = 0; i < n; ++i) {
		int a;
		std::cin >> a;

		if (a < 1) {
			count += 1 - a;
			a = 1;
		} else if (a > n) {
			count += a - n;
			a = n;
		}
		sum += a;
	}

	count += abs(int64_t(n) * (1 + n) / 2 - sum);
	std::cout << count << '\n';

	return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

int main()
{
	size_t n;
	std::cin >> n;

	int64_t count = 0;

	int sum = 0;
	for (size_t i = 0; i < n; ++i) {
		int a;
		std::cin >> a;

		if (a < 1) {
			count += 1 - a;
			a = 1;
		} else if (a > n) {
			count += a - n;
			a = n;
		}
		sum += a;
	}

	count += abs(n * (1 + n) / 2 - sum);
	std::cout << count << '\n';

	return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

int main()
{
	size_t n;
	std::cin >> n;

	int64_t count = 0;

	uint64_t sum = 0;
	for (size_t i = 0; i < n; ++i) {
		int a;
		std::cin >> a;

		if (a < 1) {
			count += 1 - a;
			a = 1;
		} else if (a > n) {
			count += a - n;
			a = n;
		}
		sum += a;
	}

	count += abs(n * (1 + n) / 2 - sum);
	std::cout << count << '\n';

	return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

int main()
{
	size_t n;
	std::cin >> n;

	int64_t count = 0;

	uint64_t sum = 0;
	for (size_t i = 0; i < n; ++i) {
		int a;
		std::cin >> a;

		if (a < 1) {
			count += 1 - a;
			a = 1;
		} else if (a > n) {
			count += a - n;
			a = n;
		}
		sum += a;
	}

	const uint64_t expected = n / 2 * (1 + n);
	if (expected > sum)
		count += expected - sum;
	else
		count += sum - expected;

	std::cout << count << '\n';

	return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

int main()
{
	size_t n;
	std::cin >> n;

	uint64_t count = 0;

	int64_t sum = 0;
	for (size_t i = 0; i < n; ++i) {
		int a;
		std::cin >> a;

		if (a < 1) {
			count += 1 - a;
			sum += 1;
		} else if (a > n) {
			count += a - n;
			sum += n;
		} else {
			sum += a;
		}
	}

	count += n * (1 + n) / 2 - sum;
	std::cout << count << '\n';

	return 0;
}


#include <bits/stdc++.h>//solved by *ALIKHAN*
#define ll long long
#define ld long double
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define ppb pop_back
#define mp make_pair
#define all(n) n.begin(), n.end()
#define timefaster ios_base::sync_with_stdio(0);cin.tie(0)

using namespace std;

const int N = (int)2e5 + 123;
const int mod = (int)1e9 + 7;
const ll INF = (ll)1e18;
int dp[101],a[10101 * 3], sum , ali,ans;
int main(){
 	timefaster;
 	int n;
 	cin >> n;
 	for(ll i = 1;i <= n; i++) cin >> a[i];
 	sort(a + 1,a + n + 1);
 	for(ll i = 1;i <= n; i++){
 		 ans += abs(i - a[i]);
 	}
 	cout << ans;

}
 	// Aksay sila


#include <bits/stdc++.h>//solved by *ALIKHAN*
#define ll long long
#define ld long double
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define ppb pop_back
#define mp make_pair
#define all(n) n.begin(), n.end()
#define timefaster ios_base::sync_with_stdio(0);cin.tie(0)

using namespace std;

const int N = (int)2e5 + 123;
const int mod = (int)1e9 + 7;
const ll INF = (ll)1e18;
int dp[101],a[101010 * 3], sum , ali,ans;
int main(){
 	timefaster;
 	int n;
 	cin >> n;
 	for(ll i = 1;i <= n; i++) cin >> a[i];
 	sort(a + 1,a + n + 1);
 	for(ll i = 1;i <= n; i++){
 		 ans += abs(i - a[i]);
 	}
 	cout << ans;

}
 	// Aksay sila


#include <bits/stdc++.h>//solved by *ALIKHAN*
#define ll long long
#define ld long double
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define ppb pop_back
#define mp make_pair
#define all(n) n.begin(), n.end()
#define timefaster ios_base::sync_with_stdio(0);cin.tie(0)

using namespace std;

const int N = (int)2e5 + 123;
const int mod = (int)1e9 + 7;
const ll INF = (ll)1e18;
long long dp[101],a[101010 * 3], sum , ali,ans;
int main(){
 	timefaster;
 	ll n;
 	cin >> n;
 	for(ll i = 1;i <= n; i++) cin >> a[i];
 	sort(a + 1,a + n + 1);
 	for(ll i = 1;i <= n; i++){
 		 ans += abs(i - a[i]);
 	}
 	cout << ans;
}
 	// Aksay sila


#include <bits/stdc++.h>//solved by *ALIKHAN*
#define ll long long
#define ld long double
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define ppb pop_back
#define mp make_pair
#define all(n) n.begin(), n.end()
#define timefaster ios_base::sync_with_stdio(0);cin.tie(0)

using namespace std;

const int N = (int)2e5 + 123;
const int mod = (int)1e9 + 7;
const ll INF = (ll)1e18;
int dp[101],a[101010 * 3], sum , ali,ans;
int main(){
 	timefaster;
 	int n;
 	cin >> n;
 	for(ll i = 1;i <= n; i++) cin >> a[i];
 	sort(a + 1,a + n + 1);
 	for(ll i = 1;i <= n; i++){
 		 ans += abs(a[i] - i);
 	}
 	cout << ans;
}
 	// Aksay sila


#include <bits/stdc++.h>//solved by *ALIKHAN*
#define ll long long
#define ld long double
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define ppb pop_back
#define mp make_pair
#define all(n) n.begin(), n.end()
#define timefaster ios_base::sync_with_stdio(0);cin.tie(0)

using namespace std;

const int N = (int)2e5 + 123;
const int mod = (int)1e9 + 7;
const ll INF = (ll)1e18;
int dp[101],a[10101 * 3], sum , ali,ans;
int main(){
 	timefaster;
 	int n;
 	cin >> n;
 	for(ll i = 1;i <= n; i++) sum += i;
 	for(ll i=0;i<n;i++){
 		 cin >> a[i];
 		 if(a[i] <= 0){
 		  ans += abs(0 - a[i]) + 1;
 		  a[i] = 1;
 		 }
 		 ali += a[i];
 	}
 	cout <<abs(sum - ali) + ans;

}
 	// Aksay sila


#include <bits/stdc++.h>//solved by *ALIKHAN*
#define ll long long
#define ld long double
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define ppb pop_back
#define mp make_pair
#define all(n) n.begin(), n.end()
#define timefaster ios_base::sync_with_stdio(0);cin.tie(0)

using namespace std;

const int N = (int)2e5 + 123;
const int mod = (int)1e9 + 7;
const ll INF = (ll)1e18;
int dp[101],a[10101], sum , ali,ans;
int main(){
 	timefaster;
 	int n;
 	cin >> n;
 	for(ll i = 1;i <= n; i++) sum += i;
 	for(ll i=0;i<n;i++){
 		 cin >> a[i];
 		 if(a[i] <= 0){
 		  ans += abs(0 - a[i]) + 1;
 		  a[i] = 1;
 		 }
 		 ali += a[i];
 	}
 	cout <<abs(sum - ali) + ans;

}
 	// Aksay sila


#include <bits/stdc++.h>//solved by *ALIKHAN*
#define ll long long
#define ld long double
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define ppb pop_back
#define mp make_pair
#define all(n) n.begin(), n.end()
#define timefaster ios_base::sync_with_stdio(0);cin.tie(0)

using namespace std;

const int N = (int)2e5 + 123;
const int mod = (int)1e9 + 7;
const ll INF = (ll)1e18;
int dp[101],a[101011 * 3], sum , ali,ans;
int main(){
 	timefaster;
 	int n;
 	cin >> n;
 	for(ll i = 1;i <= n; i++) sum += i;
 	for(ll i=0;i<n;i++){
 		 cin >> a[i];
 		 if(a[i] <= 0){
 		  ans += abs(0 - a[i]) + 1;
 		  a[i] = 1;
 		 }
 		 ali += a[i];
 	}
 	cout <<abs(sum - ali) + ans;

}
 	// Aksay sila


/*

 _____________________                              ______________________
 `-._                 \           |\__/|           /                  _.-'
     \                 \          |    |          /                  /
      \                 `-_______/      \_______-'                  /
      |                                                            |
      |                                                            |
      |                                                            |
      /                                                            \
     /_____________                                  _______________\
                   `----._                    _.----'
                          `--.            .--'
                              `-.      .-'
                                 \    /
                                  \  /
                                   \/

 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
 MM.:  .:'   `:::  .:`MMMMMMMMMMM|`MMM'|MMMMMMMMMMM':  .:'   `:::  .:'.MM
 MMMM.     :          `MMMMMMMMMM  :*'  MMMMMMMMMM'        :        .MMMM
 MMMMM.    ::    .     `MMMMMMMM'  ::   `MMMMMMMM'   .     ::   .  .MMMMM
 MMMMMM. :   :: ::'  :   :: ::'  :   :: ::'      :: ::'  :   :: ::.MMMMMM
 MMMMMMM    ;::         ;::         ;::         ;::         ;::   MMMMMMM
 MMMMMMM .:'   `:::  .:'   `:::  .:'   `:::  .:'   `:::  .:'   `::MMMMMMM
 MMMMMM'     :           :           :           :           :    `MMMMMM
 MMMMM'______::____      ::    .     ::    .     ::     ___._::____`MMMMM
 MMMMMMMMMMMMMMMMMMM`---._ :: ::'  :   :: ::'  _.--::MMMMMMMMMMMMMMMMMMMM
 MMMMMMMMMMMMMMMMMMMMMMMMMM::.         ::  .--MMMMMMMMMMMMMMMMMMMMMMMMMMM
 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM-.     ;::-MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM. .:' .M:F_P:MMMMMMMMMMMMMMMMMMMMMMMMMMM
 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.   .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\ /MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMVMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
               __
              //\\
             //  \\
            //    \\
           //      \\
          //        \\
         //          \\
        //____________\\
       //______________\\
      //                \\
     //                  \\
    //                    \\
   //______________________\\
  //________________________\\

 */
#include <vector>
#include <iterator>
#include <list>
#include <map>
#include <math.h>
#include <cmath>
#include <set>
#include <queue>
#include <deque>
#include <string>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <string.h>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
//#include <ctime>
using namespace std;

#define modulo 1000000007
#define pi 3.1415926535897932384

typedef long long  ll;
typedef long long int  lli;
typedef double d;
typedef string str;
typedef char ch;
#define  mod 1000003
void AWAD(){
    std::ios::sync_with_stdio(false);
    cin.tie(0);
}

/*int gcd(int a, int b) {
 return b == 0 ? a : gcd(b, a % b);
 }*/
/*bool cmp (pair <int, int> a, pair <int, int> b){

 if (a.first > b.first)
 return 1;

 return 0;
 }*/
/*ll pr(ll a, ll b){
 ll res = 1;
 for(ll i = 0; i < b; i++)
 {
 res*=a;
 res%=mod;
 }
 return res;
 }*/

/* bool vis[10000001];
 void seive(){
    int i , j;
    for(i=2;i<=10000001;i++)
    if(!vis[i])
        for(j=i+i;j<=10000001;j+=i)
            vis[j] = 1;
 }*/

int main(){

    std::ios::sync_with_stdio(false);
    cin.tie(0);
    int n, arr[300001], ar[300001];
    cin >> n;
    for(int i = 0; i < n; ++i){
        cin >> arr[i];
        ar[i] = arr[i];
    }
    ll ans = 0;
    for(int i = 0; i < n; ++i){
        if(arr[i] <= 0){
            ans+=(1-arr[i]);
            arr[i] = 1;
        }
        if(i > 0){
            int temp = abs(arr[i]-(arr[i-1]+1));
            if(arr[i] != arr[i]+temp){
                ans+=temp;
                arr[i] += temp;
            }
        }
    }
    ll ans2 = 0;
    for(int i = 0; i < n; ++i){
        if(ar[i] <= 0){
            ans2+=(1-ar[i]);
            ar[i] = 1;
        }
        if(i > 0){
            int temp = abs(ar[i]-(ar[i-1]-1));
            if(ar[i] != ar[i]+temp){
                ans2+=temp;
                ar[i] += temp;
                if(arr[i] <= 0){
                    cout << ans << endl;
                    return 0;
                }
            }
        }
    }
 //   cout << "ans = " << ans << " ans 2 = " << ans2 << endl;
    cout << min(ans, ans2) << endl;
    return 0;
}