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

public class Meeting {

    void solve() throws IOException {
        int a = nextInt();
        int b = nextInt();

        int moves = Math.abs(a - b);

        int movesA = moves / 2;
        int movesB = moves - movesA;

        int fatigueA = (movesA + 1) * movesA;
        int fatigueB = (movesB + 1) * movesB;

        System.out.println(fatigueA + fatigueB);
    }

    public static void main(String[] args) throws IOException {
        new Meeting().run();
    }

    void run() throws IOException {
        reader = new BufferedReader(new InputStreamReader(System.in));
//		reader = new BufferedReader(new FileReader("input.in"));
        tokenizer = null;
        out = new PrintWriter(new OutputStreamWriter(System.out));
//		out = new PrintWriter(new FileWriter("output.out"));
        solve();
        reader.close();
        out.flush();
    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter out;

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}