10
-2 1
2 -2
-1 -2
0 0
2 -1
0 -2
2 2
0 2
-1 -1
1 -2
 40
-8 24
2 -1
1 -18
72 -70
5 -4
-308 436
-19 40
36 -35
-178 265
-1 2
-7 30
-1 0
3 -2
200 -285
17 -16
-35 74
0 -4
-86 106
-1 4
-7 6
0 1
-5 4
-2 3
6 -5
-4 5
181 -262
76 -118
0 0
-7 18
-58 104
-5 6
-6 12
-3 4
1 0
11 -10
-86 130
-3 6
153 -236
-183 270
-33 64
 5
0 -1
0 -2
0 -3
0 -4
0 -5
 10
0 1
-1 -1
1 1
-1 0
1 -1
-2 -1
-2 2
-2 0
0 -2
0 -1
 20
-1 18
-2 5
-5 4
2 -33
9 -18
0 0
11 -22
2 0
-1 2
-4 41
1 6
1 -2
6 -12
0 1
-3 6
3 -6
3 -8
-1 4
2 -5
1 0
 10
2 1
-1 0
-2 -1
-1 1
0 2
2 -2
0 0
-2 -2
0 -2
-2 1
 20
-3 -3
0 4
-3 1
1 1
-1 2
-4 4
3 -1
-3 0
0 2
4 0
2 3
2 4
4 -3
-4 3
-1 1
1 3
-2 4
1 -2
1 -1
3 0
 3
0 0
0 -1
0 1
 10
2 1
-1 1
0 0
-3 1
-2 -3
-1 -2
-1 -1
1 2
3 -2
0 -2
 3
3 3
1 2
1 1
 4
0 0
1 0
2 0
3 0
 9
1 1
1 0
0 1
0 0
-1 0
-1 1
-1 -1
1 -1
0 -1
 7
1 1
-1 -1
1 0
0 1
-1 0
0 -1
0 0

4
 57
 4
 5
 21
 4
 10
 1
 1
 0
 2
 8
 3

import java.util.Comparator;
import java.util.Iterator;
import java.util.Scanner;
import java.util.SortedSet;
import java.util.TreeSet;


public class TaskB {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		
		class Point {
			int x ;
			int y;
			public Point(int x, int y) {
				super();
				this.x = x;
				this.y = y;
			}
			@Override
			public int hashCode() {
				final int prime = 31;
				int result = 1;
				result = prime * result + x;
				result = prime * result + y;
				return result;
			}
			@Override
			public boolean equals(Object obj) {
				if (this == obj)
					return true;
				if (obj == null)
					return false;
				if (getClass() != obj.getClass())
					return false;
				Point other = (Point) obj;
				if (x != other.x)
					return false;
				if (y != other.y)
					return false;
				return true;
			}
			
			
		}
		
		double start = System.currentTimeMillis();
		
		
		SortedSet<Point> points = new TreeSet<Point>(new Comparator<Point>() {

			@Override
			public int compare(Point o1, Point o2) {
				if(o1.x-o2.x ==0) {
					return o1.y - o2.y;
				} else {
					return o1.x-o2.x;
				}
				
			}


		});
		
		for(int i =0;i <n;i++) {
			int x = in.nextInt();
			int y = in.nextInt();
			points.add(new Point(x,y));
		}
		
		int count =0;
		
		Iterator<Point> iter = points.iterator();
		Point p1 = iter.next();
		Point p2 = iter.next();
		Point p3;
		
		
		while(iter.hasNext()) {

			p3 = iter.next();
			
			if((p1.x + p3.x) % 2 == 0 &&  (p1.y + p3.y) % 2 == 0) {
			if ((p1.x + p3.x) / 2 == p2.x && (p1.y + p3.y) / 2 == p2.y) {
				count++;
			}
			}
			p1=p2;
			p2=p3;
		}
//		
//		for(int i=0;i<points.size();i++) {
//			for(int j=i+1;j<points.size();j++){
//				if ((points..get(i).x  +  points.get(j).x) % 2 == 0) {					
//						int cx = (points.get(i).x +  points.get(j).x) / 2;
//						int cy = (points.get(i).y +  points.get(j).y) / 2;
//						if(points.contains(new Point(cx,cy))) {
//							count++;
//						}	
//							
//					}
//				}
				
				
				
	//		}
		
		System.out.println(count);
		//System.out.println((System.currentTimeMillis() - start) / 1000);
		
	}

}
