import java.util.Scanner; public class Main77 { public static void main(String[] args) { Main77 p = new Main77(); } public Main77() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] a = new int[201]; for(int i=0;i=0;i--) sum[i] += sum[i+1] + a[i]; for(int i=0;i 0) e+=a[j] - (j+1); else f-=(a[j] - (j+1)); } for(int j=i+1;j 0) e+=a[j] - (i*2+1-j); else f-=(a[j] - (i*2+1-j)); } if(e>=f) cur = e + sum[i*2+1]; else if(f>=e && f-e <= sum[i*2]) cur = e + sum[i*2+1]; if(cur>=0){ res = Math.min(res, cur); } } System.out.println(res); } }