4
1 2 4 3
 4
2 1 4 3
 10
1 2 10 9 7 4 8 3 6 5
 10
1 7 10 6 5 2 3 8 9 4
 4
4 3 2 1
 4
2 1 3 4
 10
1 10 9 5 3 2 4 7 8 6
 4
2 3 1 4
 4
2 4 3 1
 10
1 5 10 8 4 3 9 2 7 6
 4
1 4 3 2
 10
1 8 10 6 2 4 9 3 7 5
 4
2 3 4 1
 10
2 6 10 1 9 7 4 8 5 3
 4
4 1 2 3
 10
1 9 10 5 6 7 3 8 4 2
 4
4 2 1 3
 4
3 1 4 2
 10
1 2 3 4 6 5 7 9 10 8
 4
4 3 1 2
 4
1 3 4 2
 10
2 5 10 3 6 4 9 1 8 7
 10
2 1 10 5 8 4 9 3 7 6
 4
3 1 2 4
 10
1 6 10 7 9 5 3 8 4 2
 2
1 2
 10
1 3 10 9 4 7 5 8 6 2
 4
1 3 2 4
 4
4 2 3 1
 4
3 2 1 4
 4
3 2 4 1
 4
1 2 3 4
 10
2 7 10 1 6 3 4 8 9 5
 2
2 1
 4
3 4 2 1
 4
3 4 1 2
 10
10 1 9 2 8 3 7 4 6 5
 10
1 4 10 8 9 2 3 6 7 5
 10
2 3 10 5 4 8 6 9 7 1
 108
1 102 33 99 6 83 4 20 61 100 76 71 44 9 24 87 57 2 81 82 90 85 12 30 66 53 47 36 43 29 31 64 96 84 77 23 93 78 58 68 42 55 13 70 62 19 92 14 10 65 63 75 91 48 11 105 37 50 32 94 18 26 52 89 104 106 86 97 80 95 17 72 40 22 79 103 25 101 35 51 15 98 67 5 34 69 54 27 45 88 56 16 46 60 74 108 21 41 73 39 107 59 3 8 28 49 7 38
 4
4 1 3 2
 4
2 4 1 3
 10
2 4 10 3 9 1 5 7 8 6
 4
1 4 2 3

2 0
 4 0
 26 5
 26 6
 4 1
 2 0
 20 7
 4 0
 2 1
 26 6
 4 0
 24 6
 0 1
 28 1
 0 3
 26 1
 2 3
 4 1
 6 0
 2 2
 2 1
 28 0
 28 0
 2 3
 24 4
 0 0
 22 1
 2 0
 4 1
 4 0
 2 1
 0 0
 20 7
 0 1
 2 2
 0 2
 24 7
 20 5
 14 1
 3428 30
 2 3
 2 2
 28 0
 4 0

// in the name of god 
#include <vector>
#include <iostream>
#include <cstdio>
#include <math.h>
#include <cassert>
#include <cstring>
#include <algorithm>
#include <fstream>
#include <set>
#include <map>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp> 
#include <bits/stdc++.h>
using namespace std ;
//using namespace __gnu_pbds;
//#define ordered_set(TYPE) tree<TYPE, null_type, less<TYPE>, rb_tree_tag, tree_order_statistics_node_update>
void operator+=(vector<int>&in1,const vector<int>&in2){for(int i=0;i<in2.size();i++)in1.push_back(in2[i]);}
#define y2 sdfklgjsdkfd
#define y1 sdfklgjsdkafd
#define X first 
#define Y second
#define int long long  
typedef long long ll ;
typedef long double ld ;
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define ALL(x) (x).begin(),(x).end()
typedef pair < int , int > pii ; 
typedef pair < int , pii > pi_ii ;
typedef pair < pii , int > pii_i ;
typedef pair < pii , pii > pii_ii ;
//#define "%I64d" "%I64d
int mod = 10009 ;
const int mod1 = 1e9+9 ;
int mod2 = 0;
const int max_Mat = 3 ; 
struct Mat{int n;int a[max_Mat][max_Mat];Mat(bool x=0){for(int i=0;i<max_Mat;i++)for(int j=0;j<max_Mat;j++)a[i][j]=((i==j)?x:0);}};
inline Mat operator*(const Mat&m1,const Mat&m2){Mat ret;int n=m1.n;ret.n=n;
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
      for(int k=0;k<n;k++)
	ret.a[i][j]=(0LL+ret.a[i][j]+1LL*m1.a[i][k]*m2.a[k][j])%mod2;return ret;}inline Mat operator*=(Mat&m1,const Mat&m2){m1=m1*m2;} 
inline Mat operator^(Mat mat,int k){Mat ret(1);ret.n=mat.n;while(k){if(k&1)ret*=mat;k/=2;mat*=mat;}return ret;}
inline void operator^=(Mat &m1, int k){m1=m1^k;} 
inline void print(const Mat&mat){for(int i=0;i<mat.n;i++)for(int j=0;j<mat.n;j++)cout<<mat.a[i][j]<<((j+1==mat.n)?'\n':' ');}
const int maxL = 20 ;
const ll  inf = 1e10 ;
const int baze = 10000 ;
const int base0 = 421 ;
//  freopen ( "input.txt" , "r" , stdin ) ;
//  freopen ( "output.out", "w" , stdout) ;
const int base1 = 627 ;
const int maxn = 1e6 + 100 ;
int n , ar [ maxn ] , pos [ maxn ] ;
int st [ maxn + maxn+10 ] ;


main ( )
{
  fast ;
  cin >> n ;
  for ( int i = 1 ; i <= n ; i ++ )
    cin >> ar [ i ] ;
  int mos = 0 , man = 0 , zer = 0 , cur = 0 ; 
  for ( int i = 1 ; i <= n ; i ++ )
    {
      if ( ar [ i ] == i )
	zer ++ ;
      else if ( ar [ i ] > i )
	mos ++ ;
      else
	man ++ ;
      st [ ar [ i ] - i+n+1 ] ++ ;
      cur += abs ( ar [ i ] - i ) ;
    }
  deque < int >d  ;
  for ( int i = 1 ; i <= n ; i ++ )
    pos [ ar [ i ] ] = i , d . push_back ( ar [ i ] ) ;
  
  int ans0 = cur , ans1 = 0 ;
  for ( int i = 0 ; i < n ; i ++ )
    {
      if ( ans0 > cur )
	ans0 = cur , ans1 = i ;
      if ( d . back ( ) == n )
	zer -- ;
      else if ( d.back() > n )
	mos -- ;
      else
	man -- ;
      cur += zer - mos + man - abs(d . back()-n)+d.back()-1;
      man += zer ;
      mos -= st [ i+n+10 ] ; 
      zer = st [ i+n+10 ] ;

      if ( d . back ( ) == 1 )
	zer ++ ;
      else if ( d.back() > 1 )
	mos ++ ;
      else
	man ++ ;
      
      st [ d.back()-pos[d.back()]+n+10 ] -- ;
      st [ d.back()+i +n + 10] ++ ;     
      d . push_front ( d . back ( ) ) ;
      d . pop_back ( ) ;
    } 
  cout << ans0 << ' ' << ans1 << endl ; 
}
  
