import java.util.Scanner
object Main {
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    // val n:Long = sc.nextLong 
// 	val m:Long = sc.nextLong

val n= 0
val m= 3

	val c = convolusion(n,2) + convolusion(m, 2)
	println(c)
  }
  
  
  def convolusion(n: Long, r: Long): Long = {      
        if( n == 0 | n == 1){return 0
        }else if(r == 0){ return 1
        }else {
          val bunshi = List.range(1, n + 1).product
          val bunbo1 = List.range(1, r + 1).product
          val bunbo2 = (n-r == 0) match{
              case true => 1
              case false => List.range(1, n-r + 1).product
          }
          return bunshi / (bunbo1 * bunbo2)
        }
    }
}