import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(br.readLine());
int b = Integer.parseInt(br.readLine());
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
if(a>0){
if(b>0){
bw.write("1");
} else if( b<0){
bw.write("4");
}
} else if(a<0){
if(b>0){
bw.write("2");
}else if(b<0){
bw.write("3");
}
}
bw.flush();
bw.close();
}
}