import java.util.Scanner;
import java.io.File;
import java.io.PrintWriter;

/**
 * Created by IntelliJ IDEA.
 * User: m09mos
 * Date: 30.09.2009
 * Time: 19:10:45
 * To change this template use File | Settings | File Templates.
 */

import java.io.*;
  import      java.util.*;
public class Sum1 {

    public static void main(String[]args)throws Exception{
        Scanner s=new Scanner(new File("sumall.in"));

        long a=s.nextInt();
          long b=s.nextInt();
        long n= s.nextInt();
        long i=s.nextInt();
        long q=s.nextInt;
        for(i=1;i<=n;i++){
        q=q+i;
}

    }
          PrintWriter p=new PrintWriter(new File("sumall.out"));

      p.println(q);
       p.close();
        s.close();
            }