注意:末项为a
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int a = sc.nextInt();
int res = 0;
if (a % 2 == 0) {
res = (a - n) / -2 + 1;
}else {
res = (a - 1) / 2 + 1;
}
System.out.println(res);
}
}