import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    private static final int[][] tbl_;
    private static final int N = 101, X = 298;
    
    static {
        int[][] tbl = new int[N][X];
        for(int i = 3; i < N; i++) {
            double v = 1;
            for(int j = i + 3; j <= (i - 1) * 3; j++) {
                for(int k = i; k < N; k++) {
                    tbl[k][j] += (int)v;
                }
                if(j < i * 2) {
                    v += 0.5;
                } else {
                    v -= 0.5;
                }
            }
        }
        tbl_ = tbl;
    }
    
    public static void main(String[] args) {
        while(scn.hasNextInt()) {
            int n = scn.nextInt(), x = scn.nextInt();
            if(n > 0) {
                System.out.println(0 < x && x < X ? tbl_[n][x] : 0);
            }
        }
    }
} import java.util.*; util.* java public class Main {
    private static final Scanner scn = new Scanner(System.in);
    private static final int[][] tbl_;
    private static final int N = 101, X = 298;
    
    static {
        int[][] tbl = new int[N][X];
        for(int i = 3; i < N; i++) {
            double v = 1;
            for(int j = i + 3; j <= (i - 1) * 3; j++) {
                for(int k = i; k < N; k++) {
                    tbl[k][j] += (int)v;
                }
                if(j < i * 2) {
                    v += 0.5;
                } else {
                    v -= 0.5;
                }
            }
        }
        tbl_ = tbl;
    }
    
    public static void main(String[] args) {
        while(scn.hasNextInt()) {
            int n = scn.nextInt(), x = scn.nextInt();
            if(n > 0) {
                System.out.println(0 < x && x < X ? tbl_[n][x] : 0);
            }
        }
    }
} Main private static final Scanner scn = new Scanner(System.in); scn new Scanner(System.in) private static final int[][] tbl_; tbl_ private static final int N = 101 N 101 X = 298; X 298 public static void main(String[] args) {
        while(scn.hasNextInt()) {
            int n = scn.nextInt(), x = scn.nextInt();
            if(n > 0) {
                System.out.println(0 < x && x < X ? tbl_[n][x] : 0);
            }
        }
    } main {
        while(scn.hasNextInt()) {
            int n = scn.nextInt(), x = scn.nextInt();
            if(n > 0) {
                System.out.println(0 < x && x < X ? tbl_[n][x] : 0);
            }
        }
    } while(scn.hasNextInt()) {
            int n = scn.nextInt(), x = scn.nextInt();
            if(n > 0) {
                System.out.println(0 < x && x < X ? tbl_[n][x] : 0);
            }
        } scn.hasNextInt() scn.hasNextInt scn {
            int n = scn.nextInt(), x = scn.nextInt();
            if(n > 0) {
                System.out.println(0 < x && x < X ? tbl_[n][x] : 0);
            }
        } int n = scn.nextInt() n scn.nextInt() scn.nextInt scn x = scn.nextInt(); x scn.nextInt() scn.nextInt scn if(n > 0) {
                System.out.println(0 < x && x < X ? tbl_[n][x] : 0);
            } n > 0 n 0 {
                System.out.println(0 < x && x < X ? tbl_[n][x] : 0);
            } System.out.println(0 < x && x < X ? tbl_[n][x] : 0) System.out.println System.out System System.out 0 < x && x < X ? tbl_[n][x] : 0 0 < x && x < X 0 < x 0 x x < X x X tbl_[n][x] tbl_[n] tbl_ n x 0 String[] args args public class Main {
    private static final Scanner scn = new Scanner(System.in);
    private static final int[][] tbl_;
    private static final int N = 101, X = 298;
    
    static {
        int[][] tbl = new int[N][X];
        for(int i = 3; i < N; i++) {
            double v = 1;
            for(int j = i + 3; j <= (i - 1) * 3; j++) {
                for(int k = i; k < N; k++) {
                    tbl[k][j] += (int)v;
                }
                if(j < i * 2) {
                    v += 0.5;
                } else {
                    v -= 0.5;
                }
            }
        }
        tbl_ = tbl;
    }
    
    public static void main(String[] args) {
        while(scn.hasNextInt()) {
            int n = scn.nextInt(), x = scn.nextInt();
            if(n > 0) {
                System.out.println(0 < x && x < X ? tbl_[n][x] : 0);
            }
        }
    }
} public class Main {
    private static final Scanner scn = new Scanner(System.in);
    private static final int[][] tbl_;
    private static final int N = 101, X = 298;
    
    static {
        int[][] tbl = new int[N][X];
        for(int i = 3; i < N; i++) {
            double v = 1;
            for(int j = i + 3; j <= (i - 1) * 3; j++) {
                for(int k = i; k < N; k++) {
                    tbl[k][j] += (int)v;
                }
                if(j < i * 2) {
                    v += 0.5;
                } else {
                    v -= 0.5;
                }
            }
        }
        tbl_ = tbl;
    }
    
    public static void main(String[] args) {
        while(scn.hasNextInt()) {
            int n = scn.nextInt(), x = scn.nextInt();
            if(n > 0) {
                System.out.println(0 < x && x < X ? tbl_[n][x] : 0);
            }
        }
    }
} Main
import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    private static final int[][] tbl_;
    private static final int N = 101, X = 298;
    
    static {
        int[][] tbl = new int[N][X];
        for(int i = 3; i < N; i++) {
            double v = 1;
            for(int j = i + 3; j <= (i - 1) * 3; j++) {
                for(int k = i; k < N; k++) {
                    tbl[k][j] += (int)v;
                }
                if(j < i * 2) {
                    v += 0.5;
                } else {
                    v -= 0.5;
                }
            }
        }
        tbl_ = tbl;
    }
    
    public static void main(String[] args) {
        while(scn.hasNextInt()) {
            int n = scn.nextInt(), x = scn.nextInt();
            if(n > 0) {
                System.out.println(0 < x && x < X ? tbl_[n][x] : 0);
            }
        }
    }
}