
import java.io.*;
import java.util.*;

public class Main {

    public static final String ANSI_RESET = "\u001B[0m";
    public static final String ANSI_RED = "\u001B[31m";
    public static final String ANSI_GREEN = "\u001B[33m";

    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        Stack<Integer> stack = new Stack<>();
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      /*  String ch[] = in.readLine().split(" ");
        int n = Integer.parseInt(ch[0]);
        int a = Integer.parseInt(ch[1]);
        int b = Integer.parseInt(ch[2]);
        Set<Integer> s = new HashSet<>();
        if (a <= (n / 2) && b > (n/2)) {
            out.println("Final!");
        }else {
            
        }*/

        int a = Integer.parseInt(in.readLine());
        int b = Integer.parseInt(in.readLine());
        int min = 0;
        if (Math.abs(a - b) % 2 == 0) {
            int m = Math.abs(a - b) / 2;
            System.out.println(m * (m + 1));
        } else {
            int m = (Math.abs(a - b) - 1)/2;
            System.out.println((m * (m + 1))+m+1);
        }

 /*int n = Integer.parseInt(in.readLine());
        String ch1[] = in.readLine().split(" ");
        int x[] = new int[n];
        int y[] = new int[n];
        int avg = 0;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < x.length; i++) {
            x[i] = Integer.parseInt(ch1[i]);
            avg += x[i];
            if (x[i] > max) {
                max = x[i];
            }
            if (x[i] < min) {
                min = x[i];
            }
        }
        y[0] = min;
        y[n - 1] = max;
        for (int i = 1; i < y.length - 1; i++) {
            y[i] = min;
        }
        
        avg /= n;*/
        out.close();
    }

    public static void printString(List<Integer> stack, int sum) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < stack.size() - 1; i++) {

            sb.append(stack.get(i)).append("+");
        }
        sb.append(stack.get(stack.size() - 1));
        sb.append("=").append(sum);
        System.out.println(sb.toString());
    }

    public static void funcCard(List<List<Integer>> resList, List<Integer> list, int T[], int neededSum, int pos) {
        int sum = 0;
        for (Integer integer : list) {
            sum += integer;
        }
        if (sum == neededSum) {
            resList.add(new ArrayList<Integer>(list));
            return;
        }
        if (sum < neededSum) {
            for (int i = pos; i < T.length; i++) {
                if (pos != i && T[i] == T[i - 1]) {
                    continue;
                }
                list.add(T[i]);
                funcCard(resList, list, T, neededSum, i + 1);
                list.remove(list.size() - 1);

            }
        }
    }

    public boolean checkArithmeticProgression(int t[], int n) {
        if (n == 1) {
            return true;
        }
        radixSort(t);
        int d = t[1] - t[0];
        for (int i = 2; i < t.length; i++) {
            if (t[i] - t[i - 1] != d) {
                return false;
            }
        }
        return true;
    }

    public static int[] radixSort(int[] f) {
        return radixSort(f, f.length);
    }

    public static int[] radixSort(int[] f, int n) {
        int[] to = new int[n];
        {
            int[] b = new int[65537];
            for (int i = 0; i < n; i++) {
                b[1 + (f[i] & 0xffff)]++;
            }
            for (int i = 1; i <= 65536; i++) {
                b[i] += b[i - 1];
            }
            for (int i = 0; i < n; i++) {
                to[b[f[i] & 0xffff]++] = f[i];
            }
            int[] d = f;
            f = to;
            to = d;
        }
        {
            int[] b = new int[65537];
            for (int i = 0; i < n; i++) {
                b[1 + (f[i] >>> 16)]++;
            }
            for (int i = 1; i <= 65536; i++) {
                b[i] += b[i - 1];
            }
            for (int i = 0; i < n; i++) {
                to[b[f[i] >>> 16]++] = f[i];
            }
            int[] d = f;
            f = to;
            to = d;
        }
        return f;

    }

    private static class FastScanner {

        private final InputStream stream;
        private final byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public FastScanner(InputStream stream) {
            this.stream = stream;
        }

        public FastScanner(File file) throws FileNotFoundException {
            this.stream = new FileInputStream(file);
        }

        int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        boolean isEndline(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public int[] nextArrayInt(int n) {
            int tab[] = new int[n];
            for (int i = 0; i < n; i++) {
                tab[i] = nextInt();
            }
            return tab;
        }

        public String[] nextArrayString(int n) {
            String tab[] = new String[n];
            for (int i = 0; i < n; i++) {
                tab[i] = next();
            }
            return tab;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isEndline(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndline(c));
            return res.toString();
        }
    }
}
