import java.util.*;;
class Main{
public static void main(String[] args) {
Scanner in =new Scanner(System.in);
int p=0;
int left=0;
int right=0;
int n=in.nextInt();
p=in.nextInt();
for(int i=1;i[HTML_REMOVED]0) {
left;
}
if(Math.abs(x)>Math.abs(p)&&x<0) {
right;
}
}
if((p<0&&left==0)||(p>0&&right==0)) {
System.out.println(1);
}else {
System.out.println(left+right+1);
}
}
}