import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int one, two, three, four, w;
one = two = three = four = w = 0;
while (n -- > 0) {
String[] str = br.readLine().split(" ");
int x = Integer.parseInt(str[0]), y = Integer.parseInt(str[1]);
if (x > 0 && y > 0) one++;
else if (x < 0 && y > 0) two++;
else if (x < 0 && y < 0) three++;
else four++;
}
int t1 = Math.min(one, three), t2 = Math.min(two, four);
int t3 = Math.abs(one - three), t4 = Math.abs(two - four);
w = 2 * (t1 + t2) + Math.min(t3, t4);
System.out.println(w);
}
}