import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

class Main {
  FastScanner in = new FastScanner(System.in);
  PrintWriter out = new PrintWriter(System.out);

  public static void main(String[] args) {
    new Main().calc();
  }

  public void calc() {
    int M = in.nextInt();
    int N = in.nextInt();
    int m = 0;
    if (M >= 2) {
      m = (M * (M - 1)) / 2;
    }
    int n = 0;
    if (N >= 2) {
      n = (N * (N - 1)) / 2;
    }
    out.println(m + n);
    out.close();
  }

  class FastScanner {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
  
    public FastScanner(InputStream stream) {
      this.stream = stream;
    }
  
    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;
    }
  
    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();
    }
  
    int nextInt() {
      return Integer.parseInt(next());
    }
  
    int[] nextIntArray(int n) {
      int[] arr = new int[n];
      for (int i = 0; i < n; i++) {
        arr[i] = nextInt();
      }
      return arr;
    }
  
    int[][] nextIntMap(int n, int m) {
      int[][] map = new int[n][m];
      for (int i = 0; i < n; i++) {
          map[i] = in.nextIntArray(m);
      }
      return map;
    }
  
    long nextLong() {
        return Long.parseLong(next());
    }
  
    long[] nextLongArray(int n) {
        long[] array = new long[n];
        for (int i = 0; i < n; i++)
            array[i] = nextLong();
  
        return array;
    }
  
    long[][] nextLongMap(int n, int m) {
        long[][] map = new long[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextLongArray(m);
        }
        return map;
    }
  
    double nextDouble() {
        return Double.parseDouble(next());
    }
  
    double[] nextDoubleArray(int n) {
        double[] array = new double[n];
        for (int i = 0; i < n; i++)
            array[i] = nextDouble();
  
        return array;
    }
  
    double[][] nextDoubleMap(int n, int m) {
        double[][] map = new double[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextDoubleArray(m);
        }
        return map;
    }
  
    String[] nextStringArray(int n) {
      String[] array = new String[n];
      for (int i = 0; i < n; i++)
          array[i] = next();
  
      return array;
    }
  
    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();
    }
  }
} import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.*; util.* java class Main {
  FastScanner in = new FastScanner(System.in);
  PrintWriter out = new PrintWriter(System.out);

  public static void main(String[] args) {
    new Main().calc();
  }

  public void calc() {
    int M = in.nextInt();
    int N = in.nextInt();
    int m = 0;
    if (M >= 2) {
      m = (M * (M - 1)) / 2;
    }
    int n = 0;
    if (N >= 2) {
      n = (N * (N - 1)) / 2;
    }
    out.println(m + n);
    out.close();
  }

  class FastScanner {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
  
    public FastScanner(InputStream stream) {
      this.stream = stream;
    }
  
    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;
    }
  
    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();
    }
  
    int nextInt() {
      return Integer.parseInt(next());
    }
  
    int[] nextIntArray(int n) {
      int[] arr = new int[n];
      for (int i = 0; i < n; i++) {
        arr[i] = nextInt();
      }
      return arr;
    }
  
    int[][] nextIntMap(int n, int m) {
      int[][] map = new int[n][m];
      for (int i = 0; i < n; i++) {
          map[i] = in.nextIntArray(m);
      }
      return map;
    }
  
    long nextLong() {
        return Long.parseLong(next());
    }
  
    long[] nextLongArray(int n) {
        long[] array = new long[n];
        for (int i = 0; i < n; i++)
            array[i] = nextLong();
  
        return array;
    }
  
    long[][] nextLongMap(int n, int m) {
        long[][] map = new long[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextLongArray(m);
        }
        return map;
    }
  
    double nextDouble() {
        return Double.parseDouble(next());
    }
  
    double[] nextDoubleArray(int n) {
        double[] array = new double[n];
        for (int i = 0; i < n; i++)
            array[i] = nextDouble();
  
        return array;
    }
  
    double[][] nextDoubleMap(int n, int m) {
        double[][] map = new double[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextDoubleArray(m);
        }
        return map;
    }
  
    String[] nextStringArray(int n) {
      String[] array = new String[n];
      for (int i = 0; i < n; i++)
          array[i] = next();
  
      return array;
    }
  
    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();
    }
  }
} Main FastScanner in = new FastScanner(System.in); in new FastScanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] args) {
    new Main().calc();
  } main {
    new Main().calc();
  } new Main().calc() new Main().calc new Main() String[] args args public void calc() {
    int M = in.nextInt();
    int N = in.nextInt();
    int m = 0;
    if (M >= 2) {
      m = (M * (M - 1)) / 2;
    }
    int n = 0;
    if (N >= 2) {
      n = (N * (N - 1)) / 2;
    }
    out.println(m + n);
    out.close();
  } calc {
    int M = in.nextInt();
    int N = in.nextInt();
    int m = 0;
    if (M >= 2) {
      m = (M * (M - 1)) / 2;
    }
    int n = 0;
    if (N >= 2) {
      n = (N * (N - 1)) / 2;
    }
    out.println(m + n);
    out.close();
  } int M = in.nextInt(); M in.nextInt() in.nextInt in int N = in.nextInt(); N in.nextInt() in.nextInt in int m = 0; m 0 if (M >= 2) {
      m = (M * (M - 1)) / 2;
    } M >= 2 M 2 {
      m = (M * (M - 1)) / 2;
    } m = (M * (M - 1)) / 2 m (M * (M - 1)) / 2 (M * (M - 1)) M (M - 1) M 1 2 int n = 0; n 0 if (N >= 2) {
      n = (N * (N - 1)) / 2;
    } N >= 2 N 2 {
      n = (N * (N - 1)) / 2;
    } n = (N * (N - 1)) / 2 n (N * (N - 1)) / 2 (N * (N - 1)) N (N - 1) N 1 2 out.println(m + n) out.println out m + n m n out.close() out.close out class FastScanner {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
  
    public FastScanner(InputStream stream) {
      this.stream = stream;
    }
  
    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;
    }
  
    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();
    }
  
    int nextInt() {
      return Integer.parseInt(next());
    }
  
    int[] nextIntArray(int n) {
      int[] arr = new int[n];
      for (int i = 0; i < n; i++) {
        arr[i] = nextInt();
      }
      return arr;
    }
  
    int[][] nextIntMap(int n, int m) {
      int[][] map = new int[n][m];
      for (int i = 0; i < n; i++) {
          map[i] = in.nextIntArray(m);
      }
      return map;
    }
  
    long nextLong() {
        return Long.parseLong(next());
    }
  
    long[] nextLongArray(int n) {
        long[] array = new long[n];
        for (int i = 0; i < n; i++)
            array[i] = nextLong();
  
        return array;
    }
  
    long[][] nextLongMap(int n, int m) {
        long[][] map = new long[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextLongArray(m);
        }
        return map;
    }
  
    double nextDouble() {
        return Double.parseDouble(next());
    }
  
    double[] nextDoubleArray(int n) {
        double[] array = new double[n];
        for (int i = 0; i < n; i++)
            array[i] = nextDouble();
  
        return array;
    }
  
    double[][] nextDoubleMap(int n, int m) {
        double[][] map = new double[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextDoubleArray(m);
        }
        return map;
    }
  
    String[] nextStringArray(int n) {
      String[] array = new String[n];
      for (int i = 0; i < n; i++)
          array[i] = next();
  
      return array;
    }
  
    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();
    }
  } FastScanner private InputStream stream; stream private byte[] buf = new byte[1024]; buf new byte[1024] 1024 private int curChar; curChar private int numChars; numChars public FastScanner(InputStream stream) {
      this.stream = stream;
    } FastScanner {
      this.stream = stream;
    } this.stream = stream this.stream this this.stream stream InputStream stream stream 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++];
    } 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++];
    } if (numChars == -1)
        throw new InputMismatchException(); numChars == -1 numChars -1 1 throw new InputMismatchException(); new InputMismatchException() if (curChar >= numChars) {
        curChar = 0;
        try {
          numChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (numChars <= 0) 
          return 1;
      } curChar >= numChars curChar numChars {
        curChar = 0;
        try {
          numChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (numChars <= 0) 
          return 1;
      } curChar = 0 curChar 0 try {
          numChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        } catch (IOException e) {
          throw new InputMismatchException();
        } IOException e {
          throw new InputMismatchException();
        } throw new InputMismatchException(); new InputMismatchException() {
          numChars = stream.read(buf);
        } numChars = stream.read(buf) numChars stream.read(buf) stream.read stream buf if (numChars <= 0) 
          return 1; numChars <= 0 numChars 0 return 1; 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar boolean isSpaceChar(int c) {
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    } isSpaceChar {
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    } return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == '\t' c == '\r' c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == ' ' c ' ' c == '\n' c '\n' c == '\r' c '\r' c == '\t' c '\t' c == -1 c -1 1 int c c boolean isEndline(int c) {
        return c == '\n' || c == '\r' || c == -1;
    } isEndline {
        return c == '\n' || c == '\r' || c == -1;
    } return c == '\n' || c == '\r' || c == -1; c == '\n' || c == '\r' || c == -1 c == '\n' || c == '\r' || c == -1 c == '\n' c '\n' c == '\r' c '\r' c == -1 c -1 1 int c c 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();
    } 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();
    } int c = read(); c read() read while(isSpaceChar(c)) {
        c = read();
      } isSpaceChar(c) isSpaceChar c {
        c = read();
      } c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
        res.appendCodePoint(c);
        c = read();
      } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
        res.appendCodePoint(c);
        c = read();
      } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res int nextInt() {
      return Integer.parseInt(next());
    } nextInt {
      return Integer.parseInt(next());
    } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next int[] nextIntArray(int n) {
      int[] arr = new int[n];
      for (int i = 0; i < n; i++) {
        arr[i] = nextInt();
      }
      return arr;
    } nextIntArray {
      int[] arr = new int[n];
      for (int i = 0; i < n; i++) {
        arr[i] = nextInt();
      }
      return arr;
    } int[] arr = new int[n]; arr new int[n] n for (int i = 0; i < n; i++) {
        arr[i] = nextInt();
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        arr[i] = nextInt();
      } {
        arr[i] = nextInt();
      } arr[i] = nextInt() arr[i] arr i nextInt() nextInt return arr; arr int n n int[][] nextIntMap(int n, int m) {
      int[][] map = new int[n][m];
      for (int i = 0; i < n; i++) {
          map[i] = in.nextIntArray(m);
      }
      return map;
    } nextIntMap {
      int[][] map = new int[n][m];
      for (int i = 0; i < n; i++) {
          map[i] = in.nextIntArray(m);
      }
      return map;
    } int[][] map = new int[n][m]; map new int[n][m] n m for (int i = 0; i < n; i++) {
          map[i] = in.nextIntArray(m);
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
          map[i] = in.nextIntArray(m);
      } {
          map[i] = in.nextIntArray(m);
      } map[i] = in.nextIntArray(m) map[i] map i in.nextIntArray(m) in.nextIntArray in m return map; map int n n int m m long nextLong() {
        return Long.parseLong(next());
    } nextLong {
        return Long.parseLong(next());
    } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next long[] nextLongArray(int n) {
        long[] array = new long[n];
        for (int i = 0; i < n; i++)
            array[i] = nextLong();
  
        return array;
    } nextLongArray {
        long[] array = new long[n];
        for (int i = 0; i < n; i++)
            array[i] = nextLong();
  
        return array;
    } long[] array = new long[n]; array new long[n] n for (int i = 0; i < n; i++)
            array[i] = nextLong(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i array[i] = nextLong(); array[i] = nextLong() array[i] array i nextLong() nextLong return array; array int n n long[][] nextLongMap(int n, int m) {
        long[][] map = new long[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextLongArray(m);
        }
        return map;
    } nextLongMap {
        long[][] map = new long[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextLongArray(m);
        }
        return map;
    } long[][] map = new long[n][m]; map new long[n][m] n m for (int i = 0; i < n; i++) {
            map[i] = in.nextLongArray(m);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            map[i] = in.nextLongArray(m);
        } {
            map[i] = in.nextLongArray(m);
        } map[i] = in.nextLongArray(m) map[i] map i in.nextLongArray(m) in.nextLongArray in m return map; map int n n int m m double nextDouble() {
        return Double.parseDouble(next());
    } nextDouble {
        return Double.parseDouble(next());
    } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next double[] nextDoubleArray(int n) {
        double[] array = new double[n];
        for (int i = 0; i < n; i++)
            array[i] = nextDouble();
  
        return array;
    } nextDoubleArray {
        double[] array = new double[n];
        for (int i = 0; i < n; i++)
            array[i] = nextDouble();
  
        return array;
    } double[] array = new double[n]; array new double[n] n for (int i = 0; i < n; i++)
            array[i] = nextDouble(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i array[i] = nextDouble(); array[i] = nextDouble() array[i] array i nextDouble() nextDouble return array; array int n n double[][] nextDoubleMap(int n, int m) {
        double[][] map = new double[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextDoubleArray(m);
        }
        return map;
    } nextDoubleMap {
        double[][] map = new double[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextDoubleArray(m);
        }
        return map;
    } double[][] map = new double[n][m]; map new double[n][m] n m for (int i = 0; i < n; i++) {
            map[i] = in.nextDoubleArray(m);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            map[i] = in.nextDoubleArray(m);
        } {
            map[i] = in.nextDoubleArray(m);
        } map[i] = in.nextDoubleArray(m) map[i] map i in.nextDoubleArray(m) in.nextDoubleArray in m return map; map int n n int m m String[] nextStringArray(int n) {
      String[] array = new String[n];
      for (int i = 0; i < n; i++)
          array[i] = next();
  
      return array;
    } nextStringArray {
      String[] array = new String[n];
      for (int i = 0; i < n; i++)
          array[i] = next();
  
      return array;
    } String[] array = new String[n]; array new String[n] n for (int i = 0; i < n; i++)
          array[i] = next(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i array[i] = next(); array[i] = next() array[i] array i next() next return array; array int n n 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();
    } 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();
    } int c = read(); c read() read while (isEndline(c))
            c = read(); isEndline(c) isEndline c c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndline(c)); !isEndline(c) isEndline(c) isEndline c {
            res.appendCodePoint(c);
            c = read();
        } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

class Main {
  FastScanner in = new FastScanner(System.in);
  PrintWriter out = new PrintWriter(System.out);

  public static void main(String[] args) {
    new Main().calc();
  }

  public void calc() {
    int M = in.nextInt();
    int N = in.nextInt();
    int m = 0;
    if (M >= 2) {
      m = (M * (M - 1)) / 2;
    }
    int n = 0;
    if (N >= 2) {
      n = (N * (N - 1)) / 2;
    }
    out.println(m + n);
    out.close();
  }

  class FastScanner {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
  
    public FastScanner(InputStream stream) {
      this.stream = stream;
    }
  
    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;
    }
  
    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();
    }
  
    int nextInt() {
      return Integer.parseInt(next());
    }
  
    int[] nextIntArray(int n) {
      int[] arr = new int[n];
      for (int i = 0; i < n; i++) {
        arr[i] = nextInt();
      }
      return arr;
    }
  
    int[][] nextIntMap(int n, int m) {
      int[][] map = new int[n][m];
      for (int i = 0; i < n; i++) {
          map[i] = in.nextIntArray(m);
      }
      return map;
    }
  
    long nextLong() {
        return Long.parseLong(next());
    }
  
    long[] nextLongArray(int n) {
        long[] array = new long[n];
        for (int i = 0; i < n; i++)
            array[i] = nextLong();
  
        return array;
    }
  
    long[][] nextLongMap(int n, int m) {
        long[][] map = new long[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextLongArray(m);
        }
        return map;
    }
  
    double nextDouble() {
        return Double.parseDouble(next());
    }
  
    double[] nextDoubleArray(int n) {
        double[] array = new double[n];
        for (int i = 0; i < n; i++)
            array[i] = nextDouble();
  
        return array;
    }
  
    double[][] nextDoubleMap(int n, int m) {
        double[][] map = new double[n][m];
        for (int i = 0; i < n; i++) {
            map[i] = in.nextDoubleArray(m);
        }
        return map;
    }
  
    String[] nextStringArray(int n) {
      String[] array = new String[n];
      for (int i = 0; i < n; i++)
          array[i] = next();
  
      return array;
    }
  
    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();
    }
  }
}