import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long A = Integer.parseInt(sc.next()); long B = Integer.parseInt(sc.next()); long cnt = 0; if (A > B) { } else { for (long i = 1; i < B; i++) { if (isKadomatsu(A, B, i)) cnt++; } } // for (long i = 0; i < 2000000000; i++) { // if (isKadomatsu(A, B, i)) cnt++; // } System.out.println(cnt); } private static boolean isKadomatsu(long A, long B, long C) { // System.out.println(A + " " + B + " " + C); if (A == B || A == C || B == C) { return false; } List num = new ArrayList<>(); num.add(A); num.add(B); num.add(C); Collections.sort(num); return num.get(1) == A || num.get(1) == C; } }