Java 11
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int x = Integer.parseInt(br.readLine());
int y = Integer.parseInt(br.readLine());
br.close();
StringBuilder sb = new StringBuilder();
if (x > 0 && y > 0) {
sb.append("1");
}
else if (x < 0 && y > 0) {
sb.append("2");
}
else if (x < 0 && y < 0) {
sb.append("3");
}
else {
sb.append("4");
}
System.out.print(sb);
}
}