import java.io.*;
import java.util.*;
import java.lang.*;

public class q1 {
    public static FScanner sc;
    public static PrintWriter out;
    public static void main(String[] args) {
        sc=new FScanner();
        out=new PrintWriter(new BufferedOutputStream(System.out));

        int n = sc.nextInt();
        if(n == 1){
            out.println(-1);
        }
        else{
            StringBuilder sb = new StringBuilder();
            int[] a = new int[n];
            a[0] = 1;
            for(int p = 1; p < n; p++){
                a[p] = a[p - 1] + 1;
            }
            for(int p = 1; p < n;  p++){
                sb.append(a[p] + " ");
            }
            sb.append(a[0]);
            out.println(sb);

        }

        out.close();
    }

    //-----------------------------------------------------HERE---------------------------------------------------------

    //------------------------------------------------------------------------------------------------------------------

    //scanner
    public static class FScanner {
        BufferedReader br;
        StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.*;
import java.util.*;
import java.lang.*;

public class q1 {
    public static FScanner sc;
    public static PrintWriter out;
    public static void main(String[] args) {
        sc=new FScanner();
        out=new PrintWriter(new BufferedOutputStream(System.out));

       int n = sc.nextInt();
       if(n % 2 != 0){
           out.println(-1);
       }
       else{
           int[] a = new int[n];
           a[0] = 2;
           a[1] = 1;
           for(int p = 2; p < n; p++){
               if(p % 2 == 0) a[p] = a[p - 1] + 3;
               else a[p] = a[p - 1] - 1;
           }
           for(int p = 0; p < n; p++){
               out.print(a[p] + " ");
           }
       }

        out.close();
    }

    //-----------------------------------------------------HERE---------------------------------------------------------

    //------------------------------------------------------------------------------------------------------------------

    //scanner
    public static class FScanner {
        BufferedReader br;
        StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.util.*;
import java.io.*;

public class Main{
    public static void main(final String[] args) {
        final Scanner in = new Scanner(System.in);
        final PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        if(n==1) out.println(-1);
        else {
            for(int i=n;i>=1;i--)
                out.print(i+" ");
        }
        in.close();
        out.flush();
        out.close();
    }
}


import java.util.*;
import java.io.*;

public class Main{
    public static void main(final String[] args) {
        final Scanner in = new Scanner(System.in);
        final PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        if(n%2!=0) out.println(-1);
        else {
            for(int i=n;i>=1;i--)
                out.print(i+" ");
        }
        in.close();
        out.flush();
        out.close();
    }
}


import java.util.*;
public class Main
{
	public static void main(String[] args) {
	Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int[] a=new int[n+1];
    if(n%2!=0)
    System.out.println(-1);
    else
    {
        for(int i=1;i<=n;i++)
        {
            if(i%2!=0)
            a[i]=i+1;
            else
            a[i]=i-1;
        }

     for(int i=1;i<n+1;i++)
     {
         System.out.print(a[i]+" ");
     }
    }

}
}


import java.util.*;
public class Main
{
	public static void main(String[] args) {
	Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int[] a=new int[n+1];
    if(n%2!=0)
    System.out.println(-1);
    else
    {
        for(int i=1;i<=n;i++)
        {
            if(i%2!=0)
            a[i]=i+1;
            else
            a[i]=i-1;
        }
    }
     for(int i=1;i<n+1;i++)
     {
         System.out.print(a[i]+" ");
     }

}
}


import java.util.*;
public class prac10
{

    public static void main(String args[])
    {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        if(n%2==1)
            System.out.println("-1");
        else
        {
            for(int i=1;i<=n;i++)
            {
                if(i%2==0)
                    System.out.print(i-1+" ");
                else
                    System.out.print(i+1+" ");
            }
        }
    }
}


import java.util.*;
public class prac1
{
    public static void main(String args[])
    {
        Sacnner in=new Scanner(System.in);
        int n=in.nextInt();
        int m=in.nextInt();
        System.out.println(n^m);
    }
}


import java.util.*;
public class prac1
{
    public static void main(String args[])
    {
        Scanner in=new Scanner(System.in);
        long n=in.nextInt();
        long m=in.nextInt();
        String Str="";
        while(n!=0)
        {
            long n1=n%10;
            long m1=m%10;
            if(n1==m1)
                Str="0"+Str;
            else
                Str="1"+Str;
            n=n/10;
            m=m/10;
        }
        System.out.println(Str);
    }
}


import java.util.*;
public class prac1
{
    public static void main(String args[])
    {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int m=in.nextInt();
        String Str="";
        while(n!=0)
        {
            int n1=n%10;
            int m1=m%10;
            if(n1==m1)
                Str="0"+Str;
            else
                Str="1"+Str;
            n=n/10;
            m=m/10;
        }
        System.out.println(Str);
    }
}


public class Main{
	public static void main(String[] args) {
		int testCases;
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int arr[] = new int[num + 1];
		if(num % 2 == 1){
		    System.out.println("-1");
		}else{
		    System.out.print("2 1");
		    for(int i = 3 ; i < num ; i+2){
		        System.out.print(" " + i+1 + " " + i);
		    }
		}

	}
}


import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		int testCases;
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int arr[] = new int[num + 1];
		if(num % 2 == 1){
		    System.out.println("-1");
		}else{
		    System.out.print("2 1");
		    for(int i = 3 ; i < num ; i+=2){
		        System.out.print(" " + i+1 + " " + i);
		    }
		}

	}
}


public class Main{
	public static void main(String[] args) {
		int testCases;
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int arr[] = new int[num + 1];
		if(num % 2 == 1){
		    System.out.println("-1");
		}else{
		    System.out.print("2 1");
		    for(int i = 3 ; i < num ; i+=2){
		        System.out.print(" " + i+1 + " " + i);
		    }
		}

	}
}


import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		int testCases;
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int arr[] = new int[num + 1];
		if(num % 2 == 1){
		    System.out.println("-1");
		}else{
		    System.out.print("2 1");
		    for(int i = 3 ; i < num ; i+=2){
		        System.out.print(" " + (i+1) + " " + i);
		    }
		}

	}
}


import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		int testCases;
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int arr[] = new int[num + 1];
		if(num % 2 == 1){
		    System.out.println("-1");
		}else{
		    System.out.print("2 1");
		    for(int i = 3 ; i < num ; i+2){
		        System.out.print(" " + i+1 + " " + i);
		    }
		}

	}
}


import java.io.*;
import java.util.*;

public class perfectperm
{
	public static void main(String args[])
	{
		FastScanner in = new FastScanner();
		int n = in.nextInt();

		if(n == 1 || n == 3)
			System.out.println(-1);
		else
		{
			int data[] = new int[n];
			for(int i = 0; i < n; i++)
				data[i] = i+1;

			for(int i = 0; i < n-1; i += 2)
				swap(data, i, i+1);

			for(int i = 0; i < n; i++)
				if(data[i] == i+1)
					swap(data, i-1, i);

			for(int i = 0; i < n; i++)
			{
				if(i != 0) System.out.print(" ");
				System.out.print(data[i]);
			}
		}
	}

	private static void swap(int[] data, int i, int j)
	{
		int temp = data[i];
		data[i] = data[j];
		data[j] = temp;
	}

	public static class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s)
		{
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		public FastScanner()
		{
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken()
		{
			while (st == null || !st.hasMoreElements())
			{
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(nextToken());
		}

		long nextLong()
		{
			return Long.parseLong(nextToken());
		}

		double nextDouble()
		{
			return Double.parseDouble(nextToken());
		}

		String next()
		{
			return nextToken();
		}
	}
}


import java.io.*;
import java.util.*;

public class perfectperm
{
	public static void main(String args[])
	{
		FastScanner in = new FastScanner();
		int n = in.nextInt();

		if(n == 1)
			System.out.println(-1);
		else
		{
			int data[] = new int[n];
			for(int i = 0; i < n; i++)
				data[i] = i+1;

			int temp = data[0];
			data[0] = data[1];
			data[1] = temp;

			for(int i = 0; i < n; i++)
			{
				if(i != 0) System.out.print(" ");
				System.out.print(data[i]);
			}
		}
	}

	public static class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s)
		{
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		public FastScanner()
		{
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken()
		{
			while (st == null || !st.hasMoreElements())
			{
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(nextToken());
		}

		long nextLong()
		{
			return Long.parseLong(nextToken());
		}

		double nextDouble()
		{
			return Double.parseDouble(nextToken());
		}

		String next()
		{
			return nextToken();
		}
	}
}


import java.io.*;
import java.util.*;

public class perfectperm
{
	public static void main(String args[])
	{
		FastScanner in = new FastScanner();
		int n = in.nextInt();

		if(n % 2 == 1)
			System.out.println(-1);
		else
		{
			int data[] = new int[n];
			for(int i = 0; i < n; i++)
				data[i] = i+1;

			for(int i = 0; i < n-1; i += 2)
				swap(data, i, i+1);

			for(int i = 0; i < n; i++)
			{
				if(i != 0) System.out.print(" ");
				System.out.print(data[i]);
			}
		}
	}

	private static void swap(int[] data, int i, int j)
	{
		int temp = data[i];
		data[i] = data[j];
		data[j] = temp;
	}

	public static class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s)
		{
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		public FastScanner()
		{
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken()
		{
			while (st == null || !st.hasMoreElements())
			{
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(nextToken());
		}

		long nextLong()
		{
			return Long.parseLong(nextToken());
		}

		double nextDouble()
		{
			return Double.parseDouble(nextToken());
		}

		String next()
		{
			return nextToken();
		}
	}
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sf = new Scanner(System.in);
        int n = sf.nextInt();
        for (int i = 0; i < n; i += 2) {
            System.out.print((i + 2) + " " + (i + 1) + " ");
        }
        System.out.println();

    }
}


package n1;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sf = new Scanner(System.in);
        int n = sf.nextInt();
        if (n%2==1) System.out.println(-1);
        else {
            for (int i = 0; i < n; i += 2) {
                System.out.print((i + 2) + " " + (i + 1) + " ");
            }
            System.out.println();
        }

    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sf = new Scanner(System.in);
        int n = sf.nextInt();
        if (n%2==1) System.out.println(-1);
        else {
            for (int i = 0; i < n; i += 2) {
                System.out.print((i + 2) + " " + (i + 1) + " ");
            }
            System.out.println();
        }

    }
}


package n1;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sf = new Scanner(System.in);
        int n = sf.nextInt();
        for (int i = 0; i < n; i += 2) {
            System.out.print((i + 2) + " " + (i + 1) + " ");
        }
        System.out.println();

    }
}


import java.util.*;
public class A{
    public static void main(String sdd[]){
        Scanner s=new Scanner(System.in);
        int n=s.nextInt();
        if(n%2!=0)
            System.out.println(-1);
        else{
            for(int i=2;i<=n;i+=2){
                System.out.print(i+" ");
                System.out.print(i-1+" ");
            }
            System.out.println();
        }
    }
}


import java.util.*;
public class A{
    public static void main(String sdd[]){
        Scanner s=new Scanner(System.in);
        int n=s.nextInt();
        if(n%2!=0)
            System.out.println(-1);
        else{
            for(int i=2;i<=n;i+=2)
                System.out.print(i+" "+i-1+" ");
            System.out.println();
        }
    }
}


import java.util.Scanner;

public class PerfectPermutation_13 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();

		int[] arr = new int[n];
		if (n == 1) {
			System.out.println("-1");
			scanner.close();
			return;
		}

		int j = 0;
		for (int i = n; i > 0; i--) {
			arr[j++] = i;
		}

		if (n % 2 == 1) {
			int temp = arr[n / 2];
			arr[n / 2] = arr[n / 2 + 1];
			arr[n / 2 + 1] = temp;
		}

		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		scanner.close();
	}

}


import java.util.Scanner;

public class PerfectPermutation_13 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();

		int[] arr = new int[n];
		if (n == 1)
			System.out.println("-1");

		int j = 0;
		for (int i = n; i > 0; i--) {
			arr[j++] = i;
		}

		if (n % 2 == 1) {
			int temp = arr[n / 2];
			arr[n / 2] = arr[n / 2 + 1];
			arr[n / 2 + 1] = temp;
		}

		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		scanner.close();
	}

}


import java.util.Scanner;

public class PerfectPermutation_13 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();

		if (n % 2 == 1) {
			System.out.println("-1");
			return;
		}
		for (int i = n; i > 0; i--)
			System.out.print(i + " ");

		scanner.close();
	}

}


import java.util.Scanner;

public class PerfectPermutation_13 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();

		if (n % 2 == 1)
			System.out.println("-1");

		for (int i = n; i > 0; i--)
			System.out.print(i + " ");

		scanner.close();
	}

}


public class PerfectPermutation_13 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();

		int[] arr = new int[n];
		if (n == 1) {
			System.out.println("-1");
			scanner.close();
			return;
		}

		int j = 0;
		for (int i = n; i > 0; i--) {
			arr[j++] = i;
		}

		if (n % 2 == 1) {
			int temp = arr[n / 2];
			arr[n / 2] = arr[n / 2 + 1];
			arr[n / 2 + 1] = temp;
		}

		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		scanner.close();
	}

}


import java.util.Scanner;

public class pro{
	public static void main(String args[]){
		Scanner input=new Scanner(System.in);
		int n;
		n=input.nextInt();

		if(n%2==1)
			System.out.println("-1");
		else{
			for(int i=n;i>=0;i--){
					System.out.println(i);
			}
		}
	}
}


import java.util.Scanner;

public class pro{
	public static void main(String args[]){
		Scanner input=new Scanner(System.in);
		int n;
		n=input.nextInt();

		if(n%2==1)
			System.out.println("-1");
		else{
			for(int i=n;i>0;i--){
					System.out.print(i+" ");
			}
		}
	}
}


import java.util.Scanner;

public class pro{
	public static void main(String args[]){
		Scanner input=new Scanner(System.in);
		int n;
		n=input.nextInt();

		if(n%2==1)
			System.out.println("-1");
		else{
			for(int i=n;i>=0;i--){
					System.out.print(i+" ");
			}
		}
	}
}


import java.util.Scanner;

public class pro{
	public static void main(String args[]){
		Scanner input=new Scanner(System.in);
		int n;
		n=input.nextInt();

		if(n%2==1)
			System.out.println("-1");
		else{
			for(int i=n;i>=0;i--){
					System.out.println(i);
				}
			}
		}
	}
}


import java.util.Scanner;

public class A2j {

    public static void main(String[] args) {

         Scanner sc=new Scanner(System.in);
         int in=sc.nextInt();
         if(in==1||in==0||in%2!=0){System.out.println("-1");}

         else if(in%2==0){
            for(int i=2;i<=in;i+=2){
              for(int j=i;j>=i-1;j--){
                  System.out.print(j+" ");

            }

            }

        }

}

    }


import java.io.*;

import java.util.*;
import java.math.*;
import java.nio.charset.Charset;

public class Main{
    public static void main(String[] args) throws IOException {

         BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));

    int n=Integer.parseInt(bf.readLine());
  StringBuffer out=new StringBuffer();
  if(n==1){System.out.println("-1");}
  else{for(int i=n;i>=1;i--){out.append(i+" ");}
  if(n%2==0){System.out.println(out);}
  else{char x=out.charAt(n-1);
  out.setCharAt(n-1, out.charAt(n+1));
  out.setCharAt(n+1, x);
      System.out.println(out);}
    }}

}


import java.io.*;

import java.util.*;
import java.math.*;
import java.nio.charset.Charset;

public class Main{
    public static void main(String[] args) throws IOException {

         BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));

    int n=Integer.parseInt(bf.readLine());
  StringBuffer out=new StringBuffer();
  if(n%2!=0){System.out.println("-1");}
  else{for(int i=n;i>=1;i--){out.append(i+" ");}

      System.out.println(out);}
    }

}


import java.util.Scanner;

public class A2j {

    public static void main(String[] args) {

         Scanner sc=new Scanner(System.in);
         int in=sc.nextInt();
         if(in==1||in==0){System.out.println("-1");}

         else if(in%2==0){
            for(int i=2;i<=in;i+=2){
              for(int j=i;j>=i-1;j--){
                  System.out.print(j+" ");

            }

            }

        }
        else{

           for(int i=2;i<in;i+=2){
              for(int j=i;j>=i-1;j--){
                  System.out.print(j+" ");

            }

            }
            System.out.print(in);
        }
}

    }


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] P = new int[n];
		int k = 0;
		for(int i = 0; i<n; i++) {
			k=k+1;
			P[i] = k;
		}

		if(n==1) {
			System.out.println("-1");
		}
		else if(n%2==0) {
			for(int i = 0; i<n; i++) {
				int temp = P[i];
				P[i] = P[i+1];
				P[i+1] = temp;
				i = i + 1;
			}
			for(int j = 0; j <n; j++) {
				System.out.print(P[j] + " ");
			}
		}
		else {
			System.out.println("-1");
		}
	    in.close();
	}

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		String[] s = new String[n];
		int k = 0;
		String perm = "";
		for(int i = 0; i<n; i++) {
			k = k+1;
			s[i] = String.valueOf(k) ;
		}
		if(n==1) {
			System.out.println(-1);
		}
		else {
		    if(n%2==0 ) {
		        for(int i = 0; i<k; i++) {
			        for(int j = 0; j<k; j++) {
				        if((s[j] != s[i]) & perm.contains(s[j])==false){
					        perm = perm + s[j] + " ";
					        break;
				        }
			        }
		        }
		    }
		    else {
			    for(int i = 0; i<k-3; i++) {
			        for(int j = 0; j<k; j++) {
				        if((s[j] != s[i]) & perm.contains(s[j])==false){
					        perm = perm + s[j] + " ";
					        break;
				        }
			        }
		        }
			    perm = perm + s[k-1] + " " + s[k-3] + " " + s[k-2];
		    }
		}
		perm.trim();
		System.out.println(perm);
		in.close();
	}

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		String[] s = new String[n];
		int k = 0;
		String perm = "";
		for(int i = 0; i<n; i++) {
			k = k+1;
			s[i] = String.valueOf(k) ;
		}
		if(n==1) {
			System.out.println(-1);
		}
		else {
		    if(n%2==0 ) {
		        for(int i = 0; i<k; i++) {
			        for(int j = 0; j<k; j++) {
				        if((s[j] != s[i]) & perm.contains(s[j])==false){
					        perm = perm + s[j] + " ";
					        break;
				        }
			        }
		        }
		    }
		    else {
			    for(int i = 0; i<k-3; i++) {
			        for(int j = 0; j<k; j++) {
				        if((s[j] != s[i]) & perm.contains(s[j])==false){
					        perm = perm + s[j] + " ";
					        break;
				        }
			        }
		        }
			    perm = perm + s[k-2] + " " + s[k-3] + " " + s[k-1];
		    }
		}
		perm.trim();
		System.out.println(perm);
		in.close();
	}

}


import java.io.*;
import java.util.*;

public class A {
	public static void main(String[] args) throws Exception {
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		Scanner s = new Scanner(System.in);

		int n = Integer.parseInt(f.readLine());
		if(n == 1) {
			System.out.println(-1);
			return;
		}
		int[] ans = new int[n];
		boolean[] used = new boolean[n];
		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {
				if(i == j) continue;
				if(!used[j]) {
					used[j] = true;
					ans[j] = i+1;
					break;
				}
			}
		}
		for(int i = 0; i < n; i++) {
			if(i != n-1) out.print(ans[i] + " ");
			else out.println(ans[i]);
		}
		out.close();
	}
}


import java.io.*;
import java.util.*;

public class A {
	public static void main(String[] args) throws Exception {
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		Scanner s = new Scanner(System.in);

		int n = Integer.parseInt(f.readLine());
		if(n == 1) {
			System.out.println(-1);
			return;
		}
		int[] ans = new int[n];
		int[] idx = new int[n+1];
		boolean[] used = new boolean[n];
		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {
				if(i == j) continue;
				if(!used[j]) {
					used[j] = true;
					ans[j] = i+1;
					idx[i+1] = j;
					break;
				}
			}
		}
		for(int i = 0; i < n; i++) {
			if(ans[i] == 0) {
				System.out.println(-1);
				return;
			}
		}
		for(int i = 0; i < n; i++) {
			if(i != n-1) out.print(ans[i] + " ");
			else out.println(ans[i]);
		}
		out.close();
	}
}


import java.io.*;
import java.util.*;

public class A {
	public static void main(String[] args) throws Exception {
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		Scanner s = new Scanner(System.in);

		int n = Integer.parseInt(f.readLine());
		if(n == 1) {
			System.out.println(-1);
			return;
		}
//not same
		int[] ans = new int[n];
		int[] idx = new int[n+1];
		boolean[] used = new boolean[n];
		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {
				if(i == j) continue;
				if(!used[j]) {
					used[j] = true;
					ans[j] = i+1;
					idx[i+1] = j;
					break;
				}
			}
		}
		for(int i = 0; i < n; i++) {
			if(ans[i] == 0) {
				System.out.println(-1);
				return;
			}
		}
		for(int i = 0; i < n; i++) {
			if(i != n-1) out.print(ans[i] + " ");
			else out.println(ans[i]);
		}
		out.close();
	}
}


import java.util.Scanner;
import java.util.*;
public class Main {
    public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            byte n = sc.nextByte();
            if (n % 2 == 0) {
                System.out.print(2 + " " + 1 + " ");
                for (byte i = 3; i < n; i += 2) {
                    System.out.print((i + 1) + " " + i + " ");
                }
            }else System.out.println(-1);
    }
}


import java.util.Scanner;
import java.util.*;
public class Main {
    public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            byte n = sc.nextByte(), p = 0;
            int a[] = new int[n + 1];

            if (n != 1) {
                for (byte i = 1; i <= n; i+=2) {
                    a[p++] = i+1;
                    a[p++] = i;
                }

                for (byte i = 0; i < p; i++)
                    System.out.print(a[i] + " ");
            } else System.out.println(-1);
    }
}


import java.util.Scanner;
import java.util.*;
public class Main {
    public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            byte n = sc.nextByte();

            if (n != 1) {
                for (byte i = 1; i < n+1; i += 2) {
                    if (i == n && n%2 != 0) {
                        System.out.print(i + 1);
                        break;
                    }
                    System.out.print((i + 1) + " " + i + " ");
                }
            }
            else System.out.println(-1);
    }
}


import java.util.*;

public class Main{

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (in.hasNext())
		{
			int n = in.nextInt();
			if (n==1)
			{
				System.out.println(-1);
			}
			else
			{
				for (int i = 1; i <= n; i++)
				{
					if (i<n)
					{
						if (i%2==0)
						{
							System.out.print(i-1+" ");
						}
						else
						{
							System.out.print(i+1+" ");
						}

					}
					else
					{
						if (i%2!=0)
						{
							System.out.print(i+1);
						}
						else
						{
							System.out.print(i-1);
						}
					}
				}
				System.out.println();
			}
		}
	}

}
// 1534458793378


import java.util.Scanner;

public class Main
{

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		if (n % 2 != 0) {
			System.out.println(-1);
		} else {
			if (n == 2) {
				System.out.println("2 1");
			} else {
				int a = 2;
				int b = 1;
				String h = "";
				for (int i = 0; i < n/2; i++) {
					h += a + " " + b + " ";
					a += 2;
					b += 2;
				}
				System.out.println(h);
			}
		}

	}

}

// 1534456590963


import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		if( n % 2 == 1)
		{
			System.out.println("-1");
		}
		else
		{
			System.out.print("2 1");
			for (int i = 3; i < n; i+=2) {
				System.out.print(" "+(i+1)+" "+i);
			}
			System.out.println();
		}
	}

}

// 1534452739575


import java.io.*;
import java.util.*;

public class PerfectPermutation {
    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        String next() { // reads in the next string
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() { // reads in the next int
            return Integer.parseInt(next());
        }

        public long nextLong() { // reads in the next long
            return Long.parseLong(next());
        }

        public double nextDouble() { // reads in the next double
            return Double.parseDouble(next());
        }
    }

    static InputReader r = new InputReader(System.in);
    static PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        int n = r.nextInt();
        if (n == 1) pw.println(-1);
        else {
            for (int i = 1; i <= n; i++) {
                if (i % 2 == 0) pw.print(i - 1);
                else pw.print(i + 1);
                pw.print(" ");
            }
            pw.println();
        }
        pw.close(); // flushes the output once printing is done
    }
}


import java.io.*;
import java.util.*;

public class PerfectPermutation {
    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        String next() { // reads in the next string
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() { // reads in the next int
            return Integer.parseInt(next());
        }

        public long nextLong() { // reads in the next long
            return Long.parseLong(next());
        }

        public double nextDouble() { // reads in the next double
            return Double.parseDouble(next());
        }
    }

    static InputReader r = new InputReader(System.in);
    static PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        int n = r.nextInt();
        if (n == 1) pw.println(-1);
        else if (n % 2 == 0) {
            for (int i = 1; i <= n; i++) {
                if (i % 2 == 0) pw.print(i - 1);
                else pw.print(i + 1);
                pw.print(" ");
            }
            pw.println();
        } else {
            pw.println(-1);
        }
        pw.close(); // flushes the output once printing is done
    }
}


import java.util.Scanner;

public class PerfectPermutation {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		if(n==1) {
			System.out.println(-1);
		}
		else {
			for (int i =0; i <n/2; i++) {
				System.out.print((n-i) + " ");
			}
			for (int i = 1; i <=(n+1)/2; i++) {
				System.out.print(i + " ");
			}
		}

	}

}


import java.util.Scanner;

public class PerfectPermutation {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		if(n%2==1) {
			System.out.println(-1);
		}
		else {
			for (int i = 2; i <=n; i+=2) {
				System.out.print(i + " "  + (i-1) + " ");
			}
		}

	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.Arrays;
import java.io.IOException;
import java.util.stream.Collectors;
import java.io.InputStreamReader;
import java.util.stream.Stream;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jasper van Merle
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        APerfectPermutation solver = new APerfectPermutation();
        solver.solve(1, in, out);
        out.close();
    }

    static class APerfectPermutation {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();

            if (n == 1) {
                out.println(-1);
            } else {
                int[] nums = new int[n];

                for (int i = 0; i < n; i++) {
                    nums[i] = n + i + 1;
                }

                out.println(Arrays.stream(nums).mapToObj(String::valueOf).collect(Collectors.joining(" ")));
            }
        }

    }

    static class InputReader {
        private BufferedReader br;
        private StringTokenizer st;

        public InputReader(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


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

int main() {
	int n;
	cin >> n;
	int d[n - 1], a, b;
	for (int i = 0 ; i < n - 1; i++)
		cin >> d[i];
	cin >> a >> b;
	int sum = 0;
	for (int i = a - 1; i < b - 1; i++)
		sum += d[i];
	cout << sum;
	return 0;
}


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

bool check (int arr[], int n) {
	for (int i = 0; i < n - 1; i++)
		if (arr[i] == arr[i + 1])
			return false;
	return true;
}

int main() {
	int n;
	cin >> n;
	int d[n], a, b;
	for (int i = 0 ; i < n; i++)
		cin >> d[i];
	int sum = 0;
	sort (d, d + n);
	for (int i = 1; i < n; i++) {
		if (d[i] <= d[i - 1]) {
			sum += d[i - 1] - d[i] + 1;
			d[i] = d[i - 1] + 1;
		}
	}
	cout << sum;
	return 0;
}


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

#define pb push_back
#define ff first
#define ss second

typedef long long ll;
const int MAXN = 2 * 100 * 1000 + 17;

ll n, a[MAXN], ans;

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> a[i];
	sort(a + 1, a + n + 1);
	int ans = 0;
	for (int i = 2; i <= n; i++) {
		ans += max(a[i - 1] - a[i] + 1, 0LL);
		a[i] = a[i - 1] + 1;
	}
	cout << ans << endl;
	return 0;
}


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

bool check (int arr[], int n) {
	for (int i = 0; i < n - 1; i++)
		if (arr[i] == arr[i + 1])
			return false;
	return true;
}

int main() {
	int n;
	cin >> n;
	int d[n], a, b;
	for (int i = 0 ; i < n; i++)
		cin >> d[i];
	int sum = 0;
	sort (d, d + n);
	for (int i = 0; i < n; i++) {
		sum += (d[0] + i) - d[i];
	}
	cout << sum;
	return 0;
}


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

int main() {
	int n;
	cin >> n;
	int d[n], a, b;
	for (int i = 0 ; i < n; i++)
		cin >> d[i];
	int sum = 0;
	sort (d, d + n);
	for (int i = 0; i < n; i++) {
		sum += i - d[i] + 1;
	}
	if (sum < 0)	sum = 0;
	cout << sum;
	return 0;
}


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

int main() {
	int n;
	cin >> n;
	int d[n], a, b;
	for (int i = 0 ; i < n; i++)
		cin >> d[i];
	int sum = 0;
	sort (d, d + n);
	for (int i = 0; i < n; i++) {
		sum += i - d[i];
	}
	if (sum < 0)	sum = 0;
	cout << sum;
	return 0;
}


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

bool check (int arr[], int n) {
	for (int i = 0; i < n - 1; i++)
		if (arr[i] == arr[i + 1])
			return false;
	return true;
}

int main() {
	int n;
	cin >> n;
	int d[n], a, b;
	for (int i = 0 ; i < n; i++)
		cin >> d[i];
	int sum = 0;
	sort (d, d + n);
	while (!check(d, n)) {
		for (int i = 1; i < n; i++) {
			if (d[i] == d[i - 1]) {
				sum++;
				d[i]++;
				break;
			}
		}
	}
	cout << sum;
	return 0;
}


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

bool check (int arr[], int n) {
	for (int i = 0; i < n - 1; i++)
		if (arr[i] == arr[i + 1])
			return false;
	return true;
}

int main() {
	int n;
	cin >> n;
	int d[n], a, b;
	for (int i = 0 ; i < n; i++)
		cin >> d[i];
	int sum = 0;
	sort (d, d + n);
	while (!check(d, n)) {
		for (int i = 1; i < n; i++) {
			if (d[i] == d[i - 1]) {
				sum++;
				d[i]++;
				break;
			}
		}
		sort(d, d + n);
	}
	cout << sum;
	return 0;
}


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

#define pb push_back
#define ff first
#define ss second

typedef long long ll;
const int MAXN = 2 * 100 * 1000 + 17;

ll n, a[MAXN], ans;

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> a[i];
	sort(a + 1, a + n + 1);
	int ans = 0;
	for (int i = 2; i <= n; i++) {
		ans += max(a[i - 1] - a[i] + 1, 0LL);
		if (a[i] <= a[i - 1])
			a[i] = a[i - 1] + 1;
	}
	cout << ans << endl;
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<String>
using namespace std;
int main(){
	int n; cin >> n; string s; int num = 0; getline(cin, s);
	getline(cin, s);

	sort(s.begin(), s.end());

	for (int i = 1; i < s.length(); i++){
		if (s[i] == s[i - 1] && s[i] !=' ')
		{
			num++;
			int x = s[i] - '0';
			x++;
			s[i] = (char)(x + '0');

		}
	}cout << num << endl;

	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<String>
using namespace std;
int main(){
	int n; cin >> n; string s; int num = 0;
	getline(cin, s);

	sort(s.begin(), s.end());

	for (int i = 1; i < s.length(); i++){
		if (s[i] == s[i - 1] && s[i] !=' ')
		{
			num++;
			int x = s[i] - '0';
			x++;
			s[i] = (char)(x + '0');

		}
	}cout << num << endl;

	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	int n; cin >> n; int x = 0; int cubes = 0; int f;
	vector<int>my(n * 3, 0);
	int num = 0;
	for (int i = 1; i <= n; i++)
	{
		int k;
		cin >> k;

		my[k]++;

	}
	/*for (int i = 1; i < n; i++)
	{
	if (my[i] != 0)
	cout << my[i] << " ";

	}cout << endl;*/
	for (int i = 1; i <my.size(); i++)
	{

		if (my[i]>1)
		{

			int a = my[i] - 1;
			my[i] = my[i] - a;
			my[i + 1] += a;
			num += a;
		}

	}
	//for (int i = 1; i <= n; i++)
	//{
	//	if (my[i] != 0)
	//	cout << my[i] << " ";

	//}
	cout << endl << num << endl;

	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<String>
using namespace std;
int main(){

	int n; cin >> n; string s; int num = 0;

	vector<int>m(n);
	for (int i = 0; i < m.size(); i++)
		cin >> m[i];
	sort(m.begin(), m.end());

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

		if (m[i] == m[i - 1] && m[i] != ' ')
		{

			num++;
			m[i]++;
			sort(m.begin(), m.end());
			i = 1;

		}
	}
	cout << num << endl;

	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<String>
using namespace std;
int main(){

	int n; cin >> n; string s; int num = 0;

	vector<int>m(n);
	for (int i = 0; i < m.size(); i++)
		cin >> m[i];
	sort(m.begin(), m.end());

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

		if (m[i] == m[i - 1] )
		{

			num++;
			m[i]++;
			sort(m.begin(), m.end());
			i = 0;

		}
	}

	cout << num << endl;

	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<String>
using namespace std;
int main(){
	int n; cin >> n; string s; int num = 0;
	cin >> s;

	sort(s.begin(), s.end());

	for (int i = 1; i < n; i++){
		if (s[i] == s[i - 1])
		{
			num++;
			int x = s[i] - '0';
			x++;
			s[i] = (char)(x + '0');

		}
	}cout << num << endl;

	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	int n; cin >> n; int x = 0; int cubes = 0; int f;
	vector<int>my(n+2, 0);
	int num = 0;
	for (int i = 1; i <= n; i++)
	{
		int k;
		cin >> k;

		my[k]++;

	}
	/*for (int i = 1; i < n; i++)
	{
		if (my[i] != 0)
			cout << my[i] << " ";

	}cout << endl;*/
	for (int i = 1; i <=n; i++)
	{

		if (my[i]>1)
		{
			num++;
			int a = my[i] - 1;
			my[i] = my[i] - a;
			my[i + 1]+=a;
		}

	}

	cout << endl << num << endl;

	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<String>
using namespace std;
int main(){

	int n; cin >> n; string s; int num = 0;

	vector<int>m(n);
	for (int i = 0; i < m.size(); i++)
		cin >> m[i];
	sort(m.begin(), m.end());

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

		if (m[i] == m[i - 1] )
		{

			num++;
			m[i]++;
			sort(m.begin(), m.end());
			i = 1;

		}
	}

	cout << num << endl;

	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<String>
using namespace std;
int main(){

	int n; cin >> n; string s; int num = 0;

	vector<int>m(n);
	for (int i = 0; i < m.size(); i++)
		cin >> m[i];
	sort(m.begin(), m.end());

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

		while (m[i] == m[i - 1] )
		{

			num++;
			m[i]++;
			sort(m.begin(), m.end());

		}
	}

	cout << num << endl;

	return 0;
}


#include <iostream>

using namespace std;
int v[1001];
int main()
{
    short n,i,c,ctr=0,j,l;
    cin>>n;
    for(i=1; i<=n; i++)
    {
        cin>>c;
        v[c]++;
    }
    for(j=1; j<=n; j++)
    {
        l=j;
        while(l <= n && v[l]>1)
        {
            if(v[i+1]==0)
            {
                ctr++;
                v[i+1]++;
                v[l]--;
            }
            else
            {
                i++;
                ctr++;
            }
        }
    }
    cout<<ctr;
    return 0;
}


#include <iostream>

using namespace std;
int v[1001];
int main()
{
    short n,i,c,ctr=0,j,l;
    cin>>n;
    for(i=1; i<=n; i++)
    {
        cin>>c;
        v[c]++;
    }
    for(j=1; j<=n; j++)
    {
        i=j;
        l=i;
            while(v[l]>1)
            {
                if(v[i+1]==0)
                {
                    ctr++;
                    v[i+1]++;
                    v[l]--;
                }
                else
                {
                    i++;
                    ctr++;
                }
        }
    }
    cout<<ctr;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int cont=0;
    int n;
    cin>>n;
    int v[3001];
    for(int i=0; i<n; i++){
        cin>>v[i];
    }
    sort(v, v+n);
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            if(v[i]==v[j] && i!=j){
                v[j]+=1;
                cont++;
            }
        }
    }
    cout<<cont;


#include <iostream>

using namespace std;
int v[1001];
int main()
{
    short n,i,c,ctr=0,j,l;
    cin>>n;
    for(i=1; i<=n; i++)
    {
        cin>>c;
        v[c]++;
    }
    for(j=1; j<=n; j++)
    {
        i=j;
        l=i;
        while(l <= n && v[l]>1)
        {
            if(v[i+1]==0)
            {
                ctr++;
                v[i+1]++;
                v[l]--;
            }
            else
            {
                i++;
                ctr++;
            }
        }
    }
    cout<<ctr;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int cont=0;
    int n;
    cin>>n;
    int v[3001];
    for(int i=0; i<n; i++){
        cin>>v[i];
    }
    sort(v, v+n);
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            if(v[i]==v[j] && i!=j){
                v[j]+=1;
                cont++;
            }
        }
    }
    cout<<cont;
}


#include <iostream>

using namespace std;
int v[1001];
int main()
{
    int n,i,c,ctr=0,j,l;
    cin>>n;
    for(i=1; i<=n; i++)
    {
        cin>>c;
        v[c]++;
    }
    for(j=1; j<=n; j++)
    {
        i=j;
        l=i;
        if(v[l]>1)
        {
            while(v[l]>1)
            {
                if(v[i+1]==0)
                {
                    ctr++;
                    v[i+1]++;
                    v[l]--;
                }
                else
                {
                    i++;
                    ctr++;
                }

            }
        }
    }
    cout<<ctr;
    return 0;
}


#include <iostream>

using namespace std;
int v[1001];
int main()
{
    short n,i,c,ctr=0,j,l;
    cin>>n;
    for(i=1; i<=n; i++)
    {
        cin>>c;
        v[c]++;
    }
    for(j=1; j<=n; j++)
    {
        i=j;
        l=i;
        if(v[l]>1)
        {
            while(v[l]>1)
            {
                if(v[i+1]==0)
                {
                    ctr++;
                    v[i+1]++;
                    v[l]--;
                }
                else
                {
                    i++;
                    ctr++;
                }

            }
        }
    }
    cout<<ctr;
    return 0;
}


#include <iostream>

using namespace std;
int v[1001];
int main()
{
    int n,i,c,ctr=0,j;
    cin>>n;
    for(i=1; i<=n; i++)
    {
        cin>>c;
        v[c]++;
    }
    for(j=1; j<=n; j++)
    {
        i=j;
        if(v[i]>1)
        {
            while(v[i]>1)
            {
                if(v[i+1]==0)
                {
                    ctr++;
                    v[i+1]++;
                    v[i]--;
                }
                else
                {
                    i++;
                    ctr++;
                }

            }
        }
    }
    cout<<ctr;
    return 0;
}


import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(),aux;

		  int vector[]= new int[3000];
		  long ans=0;
		  for(int i=0;i<n;i++)
		  {
		    aux = in.nextInt();
		    if(vector[aux]==0)
		      vector[aux]=1;
		    else
		    {
		      for(int j=aux+1;j<3000;j++)
		      {
		        if(vector[j]==0)
		        {
		          vector[j]=1;
		          ans+=(j-aux);
		          break;
		        }
		      }
		    }
		  }
		System.out.println(ans);

	}

}


import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(),aux;

		  int vector[]= new int[n+1];
		  long ans=0;
		  for(int i=0;i<n;i++)
		  {
		    aux = in.nextInt();
		    if(vector[aux]==0)
		      vector[aux]=1;
		    else
		    {
		      for(int j=aux+1;j<n+1;j++)
		      {
		        if(vector[j]==0)
		        {
		          vector[j]=1;
		          ans+=(j-aux);
		          break;
		        }
		      }
		    }
		  }
		System.out.println(ans);

	}

}


import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(),aux;

		  int vector[]= new int[1000000];
		  long ans=0;
		  for(int i=0;i<n;i++) {
		    aux = in.nextInt();
		    if(vector[aux]==0)
		      vector[aux]=1;
		    else
		    {
		      for(int j=aux+1;j<1000000;j++)
		      {
		        if(vector[j]==0)
		        {
		          vector[j]=1;
		          ans+=(j-aux);
		          break;
		        }
		      }
		    }
		  }
		System.out.println(ans);

	}

}


import java.util.Scanner;

    public class SoldiersandBadges{
        public static void main(String args[]){
            Scanner s = new Scanner(System.in);
            int num = s.nextInt();
            int[] badges = new int[num];
            for(int i = 0; i < num; i++){
                badges[i] = s.nextInt();
            }
            int numCoins = 0;
            for(int i = 0; i < num - 1; i++){
                if(badges[i + 1] <= badges[i]){
                    numCoins+= badges[i] - badges[i + 1];
                    badges[i + 1] = badges[i] - 1;
                }
            }
            System.out.print(numCoins);
        }
    }


import java.util.Scanner;
import java.util.Arrays;

    public class SoldiersandBadges{
        public static void main(String args[]){
            Scanner s = new Scanner(System.in);
            int num = s.nextInt();
            int[] badges = new int[num];
            for(int i = 0; i < num; i++){
                badges[i] = s.nextInt();
            }
            int numCoins = 0;
            Arrays.sort(badges);
            for(int i = 0; i < num - 1; i++){
                if(badges[i] >= badges[i+1]){
                    numCoins += badges[i] - badges[i+1] + 1;
                    badges[i+1] = badges[i] - badges[i+1] + 1;
                }
            }
            System.out.print(numCoins);
        }
    }


import java.util.Scanner;
import java.util.Arrays;

    public class SoldiersandBadges{
        public static void main(String args[]){
            Scanner s = new Scanner(System.in);
            int num = s.nextInt();
            int[] badges = new int[num];
            for(int i = 0; i < num; i++){
                badges[i] = s.nextInt();
            }
            int numCoins = 0;
            Arrays.sort(badges);
            for(int i = 0; i < num - 1; i++){
                if(badges[i] >= badges[i+1]){
                    numCoins += badges[i] - badges[i+1] + 1;
                    badges[i+1] = badges[i+ 1] + (badges[i] - badges[i+1] + 1);
                }
            }
            System.out.print(numCoins);
        }
    }


import java.util.Scanner;
import java.util.Set;
import java.util.HashSet;

    public class SoldiersandBadges{
        public static void main(String args[]){
            Scanner s = new Scanner(System.in);
            Set<Integer> badges = new HashSet<Integer>();
            int numBadges = s.nextInt();
            s.nextLine();
            while(s.hasNext()){
                badges.add(s.nextInt());
            }
            if(badges.size() % 2 == 0){
                System.out.print(badges.size()/2);
            }
            else{
                System.out.print(0);
            }
        }
    }


import java.util.Scanner;
import java.util.Arrays;

    public class SoldiersandBadges{
        public static void main(String args[]){
            Scanner s = new Scanner(System.in);
            int num = s.nextInt();
            int[] badges = new int[num];
            for(int i = 0; i < num; i++){
                badges[i] = s.nextInt();
            }
            int numCoins = 0;
            Arrays.sort(badges);
            for(int i = 0; i < num - 1; i++){
                if(badges[i] >= badges[i+1]){
                    numCoins+= badges[i] - badges[i+1];
                    badges[i+1] = badges[i+1] + 1;
                }
            }
            System.out.print(numCoins);
        }
    }


import java.util.Scanner;
import java.util.Arrays;

    public class SoldiersandBadges{
        public static void main(String args[]){
            Scanner s = new Scanner(System.in);
            int num = s.nextInt();
            int[] badges = new int[num];
            for(int i = 0; i < num; i++){
                badges[i] = s.nextInt();
            }
            int numCoins = 0;
            Arrays.sort(badges);
            for(int i = 0; i < num - 1; i++){
                if(badges[i] >= badges[i+1]){
                    numCoins++;
                    badges[i+1] = badges[i+1] + 1;
                }
            }
            System.out.print(numCoins);
        }
    }


import java.util.Scanner;
import java.util.Set;
import java.util.HashSet;

    public class SoldiersandBadges{
        public static void main(String args[]){
            Scanner s = new Scanner(System.in);
            Set<Integer> badges = new HashSet<Integer>();
            int numBadges = s.nextInt();
            s.nextLine();
            while(s.hasNext()){
                badges.add(s.nextInt());
            }
            System.out.print(badges.size()/2);
        }
    }


import java.util.Scanner;
import java.util.Arrays;

    public class SoldiersandBadges{
        public static void main(String args[]){
            Scanner s = new Scanner(System.in);
            int num = s.nextInt();
            int[] badges = new int[num];
            for(int i = 0; i < num; i++){
                badges[i] = s.nextInt();
            }
            int numCoins = 0;
            Arrays.sort(badges);
            for(int i = 0; i < num - 1; i++){
                if(badges[i] >= badges[i+1]){
                    numCoins+= badges[i] - badges[i+1] + 1;
                    badges[i+1] = badges[i+1] + 1;
                }
            }
            System.out.print(numCoins);
        }
    }


import java.util.*;

public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        Arrays.sort(a);

        TreeSet<Integer> set = new TreeSet<Integer>();
        for (int i = 1; i <= n; i++) {
            set.add(i);
        }

        for (int i = 0; i < n; i++) {
            set.remove(a[i]);
        }

        int k = n + 1;
        int cost = 0;
        for (int i = 1; i < n; i++) {
            if (a[i] == a[i - 1]) {
                if (!set.isEmpty()) {
                    int f = set.pollFirst();
                    while (!set.isEmpty() && f <= a[i]) {
                        f = set.pollFirst();
                    }
                    if (f > a[i]) {
                        cost += f - a[i];
                    }
                    else {
                        cost += k - a[i];
                        k++;
                    }
                }
                else {
                    cost += k - a[i];
                    k++;
                }
            }
        }

        System.out.println(cost);
    }

}


import java.util.*;

public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int N = in.nextInt();

        int[] a = new int[N];
        for (int i = 0; i < N; i++) {
            a[i] = in.nextInt();
        }

        int res = 0;
        boolean flag = true;
        while (flag) {
            flag = false;

            Arrays.sort(a);

            for (int i = 1; i < N; i++) {
                int k = Math.max(a[i - 1] - a[i] + 1, 0);

                if (k != 0) {
                    a[i] = a[i - 1] + k;
                    res += k;
                    flag = true;
                    break;
                }
            }
        }

        System.out.println(res);
    }

}


import java.util.*;

public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int N = in.nextInt();

        int[] a = new int[N];
        for (int i = 0; i < N; i++) {
            a[i] = in.nextInt();
        }

        Arrays.sort(a);

        int res = 0;
        for (int i = 1; i < N; i++) {
            int k = Math.max(a[i - 1] - a[i] + 1, 0);

            if (k != 0) {
                a[i] = a[i - 1] + k;
                res += k;
            }
        }

        System.out.println(res);
    }

}


import java.util.*;

public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();

        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = in.nextInt();

        Arrays.sort(a);

        TreeSet<Integer> set = new TreeSet<Integer>();
        for (int i = 1; i <= n; i++)
            set.add(i);

        for (int i = 0; i < n; i++)
            set.remove(a[i]);

        int k = n + 1;
        int cost = 0;
        for (int i = 1; i < n; i++) {
            if (a[i] == a[i - 1]) {
                int f = -1;
                while (!set.isEmpty() && f <= a[i]) {
                    f = set.pollFirst();
                }

                if (f > a[i]) {
                    cost += f - a[i];
                }
                else {
                    cost += k - a[i];
                    k++;
                }
            }
        }

        System.out.println(cost);
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class SoldierAndBadges {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] badges = new int[n];
        for(int i=0; i<n; i++) {
            badges[i] = in.nextInt();
        }
        Arrays.sort(badges);
        int currentLevel = badges[0];
        int coins = 0;
        for(int i=1; i<n; i++) {
            if(badges[i] == currentLevel) {
                coins++;
                currentLevel++;
            } else if(badges[i] < currentLevel) {
                currentLevel++;
                coins += (currentLevel - badges[i]);
            } else {
                currentLevel = badges[i];
            }
        }

        System.out.println(coins);
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class SoldierAndBadges {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] badges = new int[n];
        for(int i=0; i<n; i++) {
            badges[i] = in.nextInt();
        }
        Arrays.sort(badges);
        int pre = badges[0];
        int coins = 0;
        for(int i=1; i<n; i++) {
            if(badges[i] == pre) {
                coins++;
                pre = badges[i] + 1;
            } else {
                pre = badges[i];
            }
        }

        System.out.println(coins);
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class may_cook_2 {

    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int n=s.nextInt();
        int ar[]=new int[n];
        for(int i=0;i<n;i++)
        {
            ar[i]=s.nextInt();
        }
        Arrays.sort(ar);
      //  for(int i=0;i<n;i++)
        //    System.out.println("-->"+ar[i]);
        int count=0;
        for(int i=1;i<n;i++)
            {
                if(ar[i]==ar[i-1])
                {
                    ar[i]++;
                    count++;
                   // System.out.println("-->");
                }
                if(ar[i]<ar[i-1])
                {
                    int temp=ar[i];
                    ar[i]=ar[i-1]+1;
                    count=count+ar[i]-temp;
                }
            }
        System.out.println(count);
    }

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class ankit_aspa {

    static class FastScanner{
        BufferedReader s;
        StringTokenizer st;

        public FastScanner(){
            st = new StringTokenizer("");
            s = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastScanner(File f) throws FileNotFoundException{
            st = new StringTokenizer("");
            s = new BufferedReader (new FileReader(f));
        }

        public int nextInt() throws IOException{
            if(st.hasMoreTokens())
                return Integer.parseInt(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextInt();
            }
        }

      public double nextDouble() throws IOException{
            if(st.hasMoreTokens())
                return Double.parseDouble(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextDouble();
            }
        }

        public long nextLong() throws IOException{
            if(st.hasMoreTokens())
                return Long.parseLong(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextLong();
            }
        }

        public String nextString() throws IOException{
            if(st.hasMoreTokens())
                return st.nextToken();
            else{
                st = new StringTokenizer(s.readLine());
                return nextString();
            }

        }
        public String readLine() throws IOException{
            return s.readLine();
        }

        public void close() throws IOException{
            s.close();
        }

    }
     private static FastScanner s = new FastScanner();
     private static PrintWriter ww = new PrintWriter(new OutputStreamWriter(System.out));

      static int count=0;
     public static void main(String[] args) throws IOException
     {
        int n=s.nextInt();int cost=0;
        int a[] = new int[n];
        for(int i=0;i<n;i++)
          a[i]=s.nextInt();
        Arrays.sort(a);

        for(int i=1;i<n;i++)
        {
            if(a[i]==a[i-1])
            {
              a[i]=a[i]+1;cost++;
            }
            else if(a[i]<a[i-1])
            {
                cost+=a[i-1]-a[i]+1;

                a[i]+=a[i-1]-a[i]+1;
            }
        }
         System.out.println(""+cost);

         s.close();
         ww.close();
     }
     public static int gcd(int a, int b){
        return b == 0 ? a : gcd(b,a%b);
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class may_cook_2 {

    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int n=s.nextInt();
        int ar[]=new int[n];
        for(int i=0;i<n;i++)
        {
            ar[i]=s.nextInt();
        }
        Arrays.sort(ar);
        int count=0;
        for(int i=1;i<n;i++)
            {
                if(ar[i]==ar[i-1])
                {
                    ar[i]++;
                    count++;
                }
            }
        System.out.println(count);
    }

}


import java.util.*;
import java.util.Arrays;
public class SoldierandBadges {
    public static void main (String []args) {
        Scanner in=new Scanner (System.in);
        int n=in.nextInt();
        int []arr=new int [n];
        for (int i=0;i<n;i++)
            arr[i]=in.nextInt();
        Arrays.sort(arr);
        int res=0;
        for (int i=1;i<n;i++) {
            if (arr[i]<=arr[i-1]) {
                res+=(arr[i-1])+1-(arr[i]);
                arr[i]=(arr[i-1])+1;
            }
        }
        System.out.println(res);
    }
}


import java.util.*;
import java.util.Arrays;
public class SoldierandBadges {
    public static void main (String []args) {
        Scanner in=new Scanner (System.in);
        int n=in.nextInt();
        int []arr=new int [n];
        for (int i=0;i<n;i++)
            arr[i]=in.nextInt();
        Arrays.sort(arr);
        int res=0;
        for (int i=1;i<n;i++) {
            if (arr[i]==arr[i-1]) {
                arr[i]++;
                res++;
            }
        }
        System.out.println(res);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class R304B {
	public static void main(String[] args) {
		FastScanner in=new FastScanner();
		int n=in.nextInt();
		TreeMap<Integer,Integer> map1=new TreeMap<Integer,Integer>();
		for(int i=0;i<n;i++){
			int a=in.nextInt();
			map1.put(a,map1.containsKey(a)?map1.get(a)+1:1);
		}
		TreeMap<Integer,Integer> map2=new TreeMap<Integer,Integer>();
		for(int key:map1.keySet()){
			if(map1.get(key)>1)
				map2.put(key,map1.get(key)-1);
		}
		int ans=0;
		for(int key:map2.keySet()){
			int m=map2.get(key);
			for(int i=0;i<m;i++){
				for(int j=key+1;j<=6000;j++){
					if(!map1.containsKey(j)){
						ans+=j-key;
						map1.put(j,1);
						break;
					}
				}
			}
		}

		System.out.println(ans);
	}
	static class FastScanner{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(){br=new BufferedReader(new InputStreamReader(System.in));}
		String nextToken(){
			while(st==null||!st.hasMoreElements())
				try{st=new StringTokenizer(br.readLine());}catch(Exception e){}
			return st.nextToken();
		}
		int nextInt(){return Integer.parseInt(nextToken());}
		long nextLong(){return Long.parseLong(nextToken());}
		double nextDouble(){return Double.parseDouble(nextToken());}
	}

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class R304B {
	public static void main(String[] args) {
		FastScanner in=new FastScanner();
		int n=in.nextInt();
		int a,sum=0,min=Integer.MAX_VALUE;
		for(int i=0;i<n;i++){
			a=in.nextInt();
			sum+=a;
			if(a<min)
				min=a;
		}

		int all=(min+n-1)*(min+n)/2;
		if(min>1){
			all-=(min-1)*min/2;
		}
		System.out.println(all-sum);
	}
	static class FastScanner{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(){br=new BufferedReader(new InputStreamReader(System.in));}
		String nextToken(){
			while(st==null||!st.hasMoreElements())
				try{st=new StringTokenizer(br.readLine());}catch(Exception e){}
			return st.nextToken();
		}
		int nextInt(){return Integer.parseInt(nextToken());}
		long nextLong(){return Long.parseLong(nextToken());}
		double nextDouble(){return Double.parseDouble(nextToken());}
	}

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class R304B {
	public static void main(String[] args) {
		FastScanner in=new FastScanner();
		int n=in.nextInt();
		int a,sum=0,min=Integer.MAX_VALUE;
		for(int i=0;i<n;i++){
			a=in.nextInt();
			sum+=a;
			if(a<min)
				min=a;
		}

		int all=(min+n-1)*(min+n)/2;
		System.out.println(all-sum);
	}
	static class FastScanner{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(){br=new BufferedReader(new InputStreamReader(System.in));}
		String nextToken(){
			while(st==null||!st.hasMoreElements())
				try{st=new StringTokenizer(br.readLine());}catch(Exception e){}
			return st.nextToken();
		}
		int nextInt(){return Integer.parseInt(nextToken());}
		long nextLong(){return Long.parseLong(nextToken());}
		double nextDouble(){return Double.parseDouble(nextToken());}
	}

}


/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
    public static void main (String[] args) throws java.lang.Exception
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[n];
        int min = 2147483647;
        for(int i = 0;i<n;i++){
            a[i]=sc.nextInt();
            min=Math.min(min,a[i]);
        }
        Arrays.sort(a);
        int x = 1;
        int count = 0;
        while(x<n){
            if(a[x]==a[x-1]){
                a[x]++;
                count++;
            }
            x++;
        }
        System.out.println(count);
    }
}


/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
    public static void main (String[] args) throws java.lang.Exception
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[n];
        int min = 2147483647;
        for(int i = 0;i<n;i++){
            a[i]=sc.nextInt();
            min=Math.min(min,a[i]);
        }
        Arrays.sort(a);
        int x = 1;
        int count = 0;
        while(x<n){
            if(a[x]=a[x-1]){
                a[x]++;
                count++;
            }
            x++;
        }
        System.out.println(count);
    }
}


/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
    public static void main (String[] args) throws java.lang.Exception
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[n];
        int min = 2147483647;
        for(int i = 0;i<n;i++){
            a[i]=sc.nextInt();
            min=Math.min(min,a[i]);
        }
        Arrays.sort(a);
        int x = 1;
        int count = 0;
        while(x<n){
            if(a[x]<=a[x-1]){
                a[x]++;
                count++;
            }
            x++;
        }
        System.out.println(count);
    }
}


/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		int min = 2147483647;
		for(int i = 0;i<n;i++){
			a[i]=sc.nextInt();
			min=Math.min(min,a[i]);
		}
		Arrays.sort(a);
		int x = 1;
		int count = 0;
		while(x<n){
			if(a[x]<=a[x-1]){
				a[x]++;
				count++;
			}
			else{
				x++;
			}
		}
		System.out.println(count);
	}
}


import java.io.*;
import java.util.*;

public class TaskG {

	public static void main(String[] args) throws IOException {
		new TaskG().solve();
	}

	PrintWriter out;

	int p;
	int a;
	int b;
	int c;
	int d;
	int n;

	void solve() throws IOException{
		Reader in = new Reader("output.txt");
		out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out)) );
		//out = new PrintWriter(new FileWriter(new File("output.txt")));

		int n = in.nextInt();
		int[] a = new int[3010];

		for (int i = 0; i < n; i++) {
			int x = in.nextInt();
			a[x]++;
		}

		long cost = 0;

		for (int i = 0; i < 3010; i++) {
			if (a[i] > 1) {
				int j = i+1;
				while (a[j] != 0) {
					j++;
				}
				cost += j-i;
				a[j] = 1;
			}
		}

		out.print(cost);
		out.flush();
		out.close();

	}

	long pow(int x, int m) {
		if (m == 0)
			return 1;
		return x*pow(x, m-1);
	}

	class Reader {

	    StringTokenizer token;
	    BufferedReader in;

	    public Reader(String file) throws IOException {
	        //in = new BufferedReader( new FileReader( file ) );
	        in = new BufferedReader( new InputStreamReader( System.in ) );
	    }

	    public byte nextByte() throws IOException {
	        return Byte.parseByte(Next());
	    }

	    public int nextInt() throws IOException {
	        return Integer.parseInt(Next());
	    }

	    public long nextLong() throws IOException {
	        return Long.parseLong(Next());
	    }

	    public String nextString() throws IOException {
	        return in.readLine();
	    }

	    public String Next() throws IOException {
	        while (token == null || !token.hasMoreTokens()) {
	            token = new StringTokenizer(in.readLine());
	        }
	        return token.nextToken();
	    }

	}

}


import java.io.*;
import java.util.*;

public class TaskG {

	public static void main(String[] args) throws IOException {
		new TaskG().solve();
	}

	PrintWriter out;

	int p;
	int a;
	int b;
	int c;
	int d;
	int n;

	void solve() throws IOException{
		Reader in = new Reader("output.txt");
		out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out)) );
		//out = new PrintWriter(new FileWriter(new File("output.txt")));

		int n = in.nextInt();
		int[] a = new int[3010];

		for (int i = 0; i < n; i++) {
			int x = in.nextInt();
			a[x]++;
		}

		long cost = 0;

		for (int i = 0; i < 3010; i++) {
			while (a[i] > 1) {
				int j = i+1;
				while (a[j] != 0) {
					j++;
				}
				cost += j-i;
				a[j] = 1;
				a[i]--;
			}
		}

		out.print(cost);
		out.flush();
		out.close();

	}

	long pow(int x, int m) {
		if (m == 0)
			return 1;
		return x*pow(x, m-1);
	}

	class Reader {

	    StringTokenizer token;
	    BufferedReader in;

	    public Reader(String file) throws IOException {
	        //in = new BufferedReader( new FileReader( file ) );
	        in = new BufferedReader( new InputStreamReader( System.in ) );
	    }

	    public byte nextByte() throws IOException {
	        return Byte.parseByte(Next());
	    }

	    public int nextInt() throws IOException {
	        return Integer.parseInt(Next());
	    }

	    public long nextLong() throws IOException {
	        return Long.parseLong(Next());
	    }

	    public String nextString() throws IOException {
	        return in.readLine();
	    }

	    public String Next() throws IOException {
	        while (token == null || !token.hasMoreTokens()) {
	            token = new StringTokenizer(in.readLine());
	        }
	        return token.nextToken();
	    }

	}

}


import java.io.*;
import java.util.*;

public class TaskG {

	public static void main(String[] args) throws IOException {
		new TaskG().solve();
	}

	PrintWriter out;

	int p;
	int a;
	int b;
	int c;
	int d;
	int n;

	void solve() throws IOException{
		Reader in = new Reader("output.txt");
		out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out)) );
		//out = new PrintWriter(new FileWriter(new File("output.txt")));

		int n = in.nextInt();
		int[] a = new int[30100];

		for (int i = 0; i < n; i++) {
			int x = in.nextInt();
			a[x]++;
		}

		long cost = 0;

		for (int i = 0; i < 3010; i++) {
			while (a[i] > 1) {
				int j = i+1;
				while (a[j] != 0) {
					j++;
				}
				cost += j-i;
				a[j] = 1;
				a[i]--;
			}
		}

		out.print(cost);
		out.flush();
		out.close();

	}

	long pow(int x, int m) {
		if (m == 0)
			return 1;
		return x*pow(x, m-1);
	}

	class Reader {

	    StringTokenizer token;
	    BufferedReader in;

	    public Reader(String file) throws IOException {
	        //in = new BufferedReader( new FileReader( file ) );
	        in = new BufferedReader( new InputStreamReader( System.in ) );
	    }

	    public byte nextByte() throws IOException {
	        return Byte.parseByte(Next());
	    }

	    public int nextInt() throws IOException {
	        return Integer.parseInt(Next());
	    }

	    public long nextLong() throws IOException {
	        return Long.parseLong(Next());
	    }

	    public String nextString() throws IOException {
	        return in.readLine();
	    }

	    public String Next() throws IOException {
	        while (token == null || !token.hasMoreTokens()) {
	            token = new StringTokenizer(in.readLine());
	        }
	        return token.nextToken();
	    }

	}

}


import java.io.*;
import java.util.*;

public class TaskG {

	public static void main(String[] args) throws IOException {
		new TaskG().solve();
	}

	PrintWriter out;

	int p;
	int a;
	int b;
	int c;
	int d;
	int n;

	void solve() throws IOException{
		Reader in = new Reader("output.txt");
		out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out)) );
		//out = new PrintWriter(new FileWriter(new File("output.txt")));

		int n = in.nextInt();
		int[] a = new int[3010];

		for (int i = 0; i < n; i++) {
			int x = in.nextInt();
			a[x]++;
		}

		long cost = 0;

		for (int i = 0; i < 3010; i++) {
			while (a[i] > 1) {
				int j = i+1;
				while (a[j] != 0) {
					j++;
				}
				cost += j-i;
				a[j] = 1;
			}
		}

		out.print(cost);
		out.flush();
		out.close();

	}

	long pow(int x, int m) {
		if (m == 0)
			return 1;
		return x*pow(x, m-1);
	}

	class Reader {

	    StringTokenizer token;
	    BufferedReader in;

	    public Reader(String file) throws IOException {
	        //in = new BufferedReader( new FileReader( file ) );
	        in = new BufferedReader( new InputStreamReader( System.in ) );
	    }

	    public byte nextByte() throws IOException {
	        return Byte.parseByte(Next());
	    }

	    public int nextInt() throws IOException {
	        return Integer.parseInt(Next());
	    }

	    public long nextLong() throws IOException {
	        return Long.parseLong(Next());
	    }

	    public String nextString() throws IOException {
	        return in.readLine();
	    }

	    public String Next() throws IOException {
	        while (token == null || !token.hasMoreTokens()) {
	            token = new StringTokenizer(in.readLine());
	        }
	        return token.nextToken();
	    }

	}

}


import java.util.Arrays;
import java.util.Scanner;

public class MainB {
	MyScanner sc = new MyScanner();
	Scanner sc2 = new Scanner(System.in);
	long start = System.currentTimeMillis();
	long fin = System.currentTimeMillis();
	final int MOD = 1000000000;
	int[] dx = { 1, 0, 0, -1 };
	int[] dy = { 0, 1, -1, 0 };

	void run() {
		int n = sc.nextInt();
		int[] a = sc.nextIntArray(n);
		Arrays.sort(a);
		int add = 0;
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				if (a[i] == a[j]) {
					a[j]++;
					add++;
				} else if (a[i] < a[j]) {
					break;
				}
			}
		}
		System.out.println(add);
	}

	public static void main(String[] args) {
		new MainB().run();
	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	void debug2(char[][] array) {
		for (int i = 0; i < array.length; i++) {
			for (int j = 0; j < array[i].length; j++) {
				System.out.print(array[i][j]);
			}
			System.out.println();
		}
	}

	boolean inner(int h, int w, int limH, int limW) {
		return 0 <= h && h < limH && 0 <= w && w < limW;
	}

	void swap(int[] x, int a, int b) {
		int tmp = x[a];
		x[a] = x[b];
		x[b] = tmp;
	}

	// find minimum i (a[i] >= border)
	int lower_bound(int a[], int border) {
		int l = -1;
		int r = a.length;
		while (r - l > 1) {
			int mid = (l + r) / 2;
			if (border <= a[mid]) {
				r = mid;
			} else {
				l = mid;
			}
		}
		// r = l + 1
		return r;
	}

	boolean palindrome(String s) {
		for (int i = 0; i < s.length() / 2; i++) {
			if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
				return false;
			}
		}
		return true;
	}

	class MyScanner {
		int nextInt() {
			try {
				int c = System.in.read();
				while (c != '-' && (c < '0' || '9' < c))
					c = System.in.read();
				if (c == '-')
					return -nextInt();
				int res = 0;
				do {
					res *= 10;
					res += c - '0';
					c = System.in.read();
				} while ('0' <= c && c <= '9');
				return res;
			} catch (Exception e) {
				return -1;
			}
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String next() {
			try {
				StringBuilder res = new StringBuilder("");
				int c = System.in.read();
				while (Character.isWhitespace(c))
					c = System.in.read();
				do {
					res.append((char) c);
				} while (!Character.isWhitespace(c = System.in.read()));
				return res.toString();
			} catch (Exception e) {
				return null;
			}
		}

		int[] nextIntArray(int n) {
			int[] in = new int[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextInt();
			}
			return in;
		}

		int[][] nextInt2dArray(int n, int m) {
			int[][] in = new int[n][m];
			for (int i = 0; i < n; i++) {
				in[i] = nextIntArray(m);
			}
			return in;
		}

		double[] nextDoubleArray(int n) {
			double[] in = new double[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextDouble();
			}
			return in;
		}

		long[] nextLongArray(int n) {
			long[] in = new long[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextLong();
			}
			return in;
		}

		char[][] nextCharField(int n, int m) {
			char[][] in = new char[n][m];
			for (int i = 0; i < n; i++) {
				String s = sc.next();
				for (int j = 0; j < m; j++) {
					in[i][j] = s.charAt(j);
				}
			}
			return in;
		}
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class MainB {
	Scanner sc = new Scanner(System.in);

	void run() {
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) a[i] = sc.nextInt();
		Arrays.sort(a);
		int add = 0;
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				if (a[i] == a[j]) {
					a[j]++;
					add++;
				}
			}
		}
		System.out.println(add);
	}

	public static void main(String[] args) {
		new MainB().run();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 *
1 2 2 3 5

1 2 3 3 5
1 2 3 4 5

4
1 2 1 1
1 2 3
 *
 * */
public class B_Div2_304 {
    public static void main(String[]arg) throws IOException
    {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        StringTokenizer st = new StringTokenizer(in.readLine());
        int[]factor = new int[n];
        int i;
        for(i = 0; i < n; i++)
        {
            factor[i] = Integer.parseInt(st.nextToken());
        }
        Arrays.sort(factor);
        int ans = 0;
        for(i = 1; i < n; i++)
        {
            //System.out.println(factor[i-1] + " " + factor[i]);
            if(factor[i-1] == factor[i])
            {
                factor[i]++;
                ans++;
            }
            else if(factor[i-1] > factor[i])
            {
                ans+= factor[i-1] - factor[i] + 1;
                factor[i] += factor[i-1] - factor[i] + 1;
            }
        }

        //System.out.println(Arrays.toString(factor));
        System.out.println(ans);
    }
}


import java.util.*;
public class b546
{
	public static void main(String ar[])
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
		int ans=0;
		int arr[]=new int[n];
		for(int i=0;i<n;i++)
			arr[i]=ob.nextInt();
		Arrays.sort(arr);
		for(int i=0;i<n-1;i++)
		{
			for(int j=i+1;j<n;j++)
			{
				if(arr[i]==arr[j])
				{
					arr[j]++;
					ans+=1;
				}
				else
					break;
				}
			}

		System.out.println(ans);
	}
}


import java.util.*;
public class b546
{
	public static void main(String ar[])
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
		int ans=0;
		int arr[]=new int[n];
		for(int i=0;i<n;i++)
			arr[i]=ob.nextInt();
		Arrays.sort(arr);
		int x=arr[0];
		for(int i=1;i<n;i++)
		{
			if(x!=arr[i])
				x=arr[i];
			else
			{
				ans=ans+(x-arr[i]+1);
				arr[i]=x+1;
				x=arr[i];
			}
		}
		System.out.println(ans);
	}
}


public class Coolness {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
          Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
          int n  = s.nextInt();
          int []a = new int [n];
          for (int i = 0; i < n; i++) {
             a[i] = s.nextInt();
        }
          System.out.println(cantCambios(a));
    }

    public static int cantCambios(int[]a){
        Arrays.sort(a);
        int r = 0;
        for (int i = 0; i < a.length; i++) {
           if(i + 1 < a.length && a[i] == a[i+1]){
               a[i+1]++;
               r++;
           }
        }
       return r;
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Nicolás
 */
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
          Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
          int n  = s.nextInt();
          int []a = new int [n];
          for (int i = 0; i < n; i++) {
             a[i] = s.nextInt();
        }
          System.out.println(cantCambios(a));
    }
    /*
    if(i + 1 < a.length && a[i] == a[i+1]){
               a[i+1]++;
               r++;
           }
    */
    public static int cantCambios(int[]a){
        Arrays.sort(a);
        int r = 0;
        for (int i = 0; i < a.length -1; i++) {
            if(a[i] >= a[i+1]){
                int dif = Math.abs(a[i+1] - a[i]);
                a[i+1] = a[i+1] + dif + 1;
                r = r + dif + 1;
            }
        }
       return r;
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

/**
 *
 * @author Nicolás
 */
public class Coolness {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
          Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
          int n  = s.nextInt();
          int []a = new int [n];
          for (int i = 0; i < n; i++) {
             a[i] = s.nextInt();
        }
          System.out.println(cantCambios(a));
    }

    public static int cantCambios(int[]a){
        Arrays.sort(a);
        int r = 0;
        for (int i = 0; i < a.length; i++) {
           if(i + 1 < a.length && a[i] == a[i+1]){
               a[i+1]++;
               r++;
           }
        }
       return r;
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package coolness;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

/**
 *
 * @author Nicolás
 */
public class Coolness {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
          Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
          int n  = s.nextInt();
          int []a = new int [n];
          for (int i = 0; i < n; i++) {
             a[i] = s.nextInt();
        }
          System.out.println(cantCambios(a));
    }

    public static int cantCambios(int[]a){
        Arrays.sort(a);
        int r = 0;
        for (int i = 0; i < a.length; i++) {
           if(i + 1 < a.length && a[i] == a[i+1]){
               a[i+1]++;
               r++;
           }
        }
       return r;
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
          Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
          int n  = s.nextInt();
          int []a = new int [n];
          for (int i = 0; i < n; i++) {
             a[i] = s.nextInt();
        }
          System.out.println(cantCambios(a));
    }

    public static int cantCambios(int[]a){
        Arrays.sort(a);
        int r = 0;
        for (int i = 0; i < a.length; i++) {
           if(i + 1 < a.length && a[i] == a[i+1]){
               a[i+1]++;
               r++;
           }
        }
       return r;
    }
}


import java.util.*;

public class Badge {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int[] badges = new int[n+2];
    int counter = 0;
    for (int i = 0; i < n; i++) {
      badges[input.nextInt()]++;
    }
    for (int i = 0; i <= n; i++) {
      while (badges[i] > 1) {
        badges[i]--;
        badges[i+1]++;
        counter++;
      }
    }
    System.out.println(counter);
  }
}


import java.util.*;

public class Badge {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int[] badges = new int[n+1];
    int counter = 0;
    for (int i = 0; i < n; i++) {
      badges[input.nextInt()]++;
    }
    for (int i = 0; i < n; i++) {
      while (badges[i] > 1) {
        badges[i]--;
        badges[i+1]++;
        counter++;
      }
    }
    System.out.println(counter);
  }
}


import java.util.*;

public class Badge {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int[] badges = new int[n*2+1];
    int counter = 0;
    for (int i = 0; i < n; i++) {
      badges[input.nextInt()]++;
    }
    for (int i = 0; i < badges.length; i++) {
      while (badges[i] > 1) {
        badges[i]--;
        badges[i+1]++;
        counter++;
      }
    }
    System.out.println(counter);
  }
}


import java.util.*;
import java.math.*;

public class mayn {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		boolean [] a = new boolean [n];
		for (int i=0 ; i<n ; i++) {
			a[i] = false;
		}
		int total =0;
		for (int i=0 ; i<n ; i++) {
			int k = scan.nextInt() - 1;
			if (a[k]) {
				int j = k;
				while(a[k]) {
					k++;
					total++;
				}
			}
			a[k] = true;
		}
		System.out.println(total);
	}
}


import java.util.*;
import java.math.*;

public class mayn {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		boolean [] a = new boolean [2*n];
		for (int i=0 ; i<2*n ; i++) {
			a[i] = false;
		}
		int total =0;
		for (int i=0 ; i<n ; i++) {
			int k = scan.nextInt() - 1;
			if (a[k]) {
				int j = k;
				while(a[k]) {
					k++;
					total++;
					if (k==2*n) {
						k=0;
					}
				}
			}
			a[k] = true;
		}
		System.out.println(total);
	}
}


import java.util.*;
import java.math.*;

public class mayn {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		boolean [] a = new boolean [n];
		for (int i=0 ; i<n ; i++) {
			a[i] = false;
		}
		int total =0;
		for (int i=0 ; i<n ; i++) {
			int k = scan.nextInt() - 1;
			if (a[k]) {
				int j = k;
				while(a[k]) {
					k++;
					total++;
					if (k==n) {
						k=0;
					}
				}
			}
			a[k] = true;
		}
		System.out.println(total);
	}
}


import java.util.*;
import java.math.*;

public class mayn {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		boolean [] a = new boolean [2*n];
		for (int i=0 ; i<2*n ; i++) {
			a[i] = false;
		}
		int total =0;
		for (int i=0 ; i<2*n ; i++) {
			int k = scan.nextInt() - 1;
			if (a[k]) {
				int j = k;
				while(a[k]) {
					k++;
					total++;
					if (k==2*n) {
						k=0;
					}
				}
			}
			a[k] = true;
		}
		System.out.println(total);
	}
}


import java.io.*;
import java.io.PrintWriter;
import java.util.*;
import java.io.InputStream;
import java.io.DataInputStream;

public class Main
{// static{ System.out.println(" hello ");}

  public static void main(String[] args) throws IOException
     {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader scn = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

       int n=scn.ni();
       int a[]=new int[n];
       for (int i=0;i<n;i++)
       {
       a[i]=scn.ni();

        }
        Arrays.sort(a); int cnt=0;
        for (int i=1;i<n;i++)
        {
            int temp=a[i-1]+1;
          if (a[i]<temp) { cnt+=temp-a[i];
            a[i]=temp;}

        }
        out.println(cnt);
          out.close();
     }

   }
  class num //implements Comparator<num>
    {

        public int start;
        public int end;
        num()
        {

        }
        num(int x,int y)
        {
            this.start = x;
            this.end =y;
        }
        public int getstart()
        {
        return start;
        }
        public int getend()
        {
        return end;
        }
    /*    public boolean equals(Object n1)
        {num n=(num)n1;
        if (this.start==n.start && this.end==n.end) return true;
        else return false;

        }

         public int hashCode()
         {
        final int prime = 31;
        int result = 1;
        result = prime * result
                + start;
        result = prime * result+end;

        return result;
       }

       public int compare(num o1, num o2) {
              if (o1.getstart() > o2.getstart())
            return (o1.getstart()-o2.getstart());
            else if (o1.getstart() == o2.getstart())
            return (o1.getend()-o2.getend());
            else
            return (o1.getstart()-o2.getstart());

        }
      */

    }

class FastReader
{

    public InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public FastReader(InputStream stream)
    {
        this.stream = stream;
    }

    public int read()
    {
        if (numChars == -1)
        {
            throw new InputMismatchException ();
        }
        if (curChar >= numChars)
        {
            curChar = 0;
            try
            {
                numChars = stream.read (buf);
            } catch (IOException e)
            {
                throw new InputMismatchException ();
            }
            if (numChars <= 0)
            {
                return -1;
            }
        }
        return buf[curChar++];
    }

 public char nc()
    {
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        return (char) c;
    }

    public int ni()
    {
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        int sgn = 1;
        if (c == '-')
        {
            sgn = -1;
            c = read ();
        }
        int res = 0;
        do
        {
            if (c < '0' || c > '9')
            {

            }
            res *= 10;
            res += c - '0';
            c = read ();
        } while (!isSpaceChar (c));
        return res * sgn;
    }

    public long nl()
    {
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        int sgn = 1;
        if (c == '-')
        {
            sgn = -1;
            c = read ();
        }
        long res = 0;
        do
        {
            if (c < '0' || c > '9')
            {
                throw new InputMismatchException ();
            }
            res *= 10;
            res += c - '0';
            c = read ();
        } while (!isSpaceChar (c));
        return res * sgn;
    }

    public String ns()
    {
        int c = read ();
        while (isSpaceChar (c))
            c = read ();
        StringBuilder res = new StringBuilder ();
        do
        {
            res.appendCodePoint (c);
            c = read ();
        } while (!isSpaceChar (c));
        return res.toString ();
    }

    public boolean isSpaceChar(int c)
    {
        if (filter != null)
        {
            return filter.isSpaceChar (c);
        }
        return isWhitespace (c);
    }

    public static boolean isWhitespace(int c)
    {
        return c==' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next()
    {
        return ns ();
    }

    public interface SpaceCharFilter
    {
        public boolean isSpaceChar(int ch);
    }
}