jiahuimbzuai/CoQuIR huggingface dataset:
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.NoSuchElementException;
import java.util.concurrent.PriorityBlockingQueue;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        int m = sc.nextInt();
        long ans = 0;

        ans += (n-1) * n / 2;
        ans += (m-1) * m / 2;

        System.out.println(ans);
    }

    private static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;

        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (hasNextByte())
                return buffer[ptr++];
            else
                return -1;
        }

        private static boolean isPrintableChar(int c) {
            return 33 <= c && c <= 126;
        }

        public boolean hasNext() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr]))
                ptr++;
            return hasNextByte();
        }

        public String next() {
            if (!hasNext())
                throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public long nextLong() {
            if (!hasNext())
                throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while (true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if (b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }

        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
                throw new NumberFormatException();
            return (int) nl;
        }

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

}
//  [java]
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
If I'm the sun, you're the moon
Because when I go up, you go down
*******************************
I'm working for the day I will surpass you
https://www.a2oj.com/Ladder16.html
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class Main
   {
      public static void main(String omkar[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));  
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int M = Integer.parseInt(st.nextToken());
         System.out.println(N*(N-1)/2+M*(M-1)/2);
      }
   }
//  [java]
import java.util.*;


public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        String ans="Yes";
        int a=0;
        if(s.length()%2==1){
            a=1;
        }
        
        for(int i=0; i<s.length()/2; i++){
            if(s.charAt(i)!=s.charAt(s.length()-i-1)){
                ans="No";
                break;
            }
            if(s.charAt(i)!=s.charAt(s.length()/2-1-i)){
                ans="No";
                break;
            }
            if(s.charAt(s.length()/2+a)!=s.charAt(s.length()-i-1)){
                ans="No";
                break;
            }
        }
        
        
        System.out.println(ans);
        
	}
}
//  [java]
import java.util.Scanner;
public class Main {
  public static void main(String[] args) {
  Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] n = new int[N];
        for(int i=0; i<N; i++) {
          n[i] = sc.nextInt();
        }
    int M = sc.nextInt();
    int[] m = new int[N];
        for(int i=0; i<N; i++) {
          m[i] = sc.nextInt();
        }
    int cnt = 0;
    for(int i=0; i<=N; i++){
        if((m[i]+n[i])%2 == 0) {
            cnt++;
        } else {
          continue;
        }
      }
    }
    System.out.println(cnt);
  }
}
//  [java]
import java.util.Scanner;
public class Main {
  public static void main(String[] args) {
  Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int cnt = 0;
    for(int i=0; i<=N; i++){
      for(int j=0; j<=M; j++){
        int k = i+j;
        if(k%2 == 0) {
            cnt++;
        } else {
          continue;
        }
      }
    }
    System.out.println(cnt);
  }
}
//  [cpp]
#include <stdio.h>

int main()
{
   int m, n;
   scanf("%d %d", &n, &m);
   
   printf ("%d\n", n*(n-1)/2 + m*(m-1)/2);

   return 0;
}
//  [cpp]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {
    int N,M;
    int ans;
    scanf("%d %d",&N,&M);

    ans = (N-1)*N/2 + (M-1)*M/2;
    printf("%d",ans);

    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N,M;
  cin >>N>>M;
  if(N==1&&M==1){
    cout<<0<<endl;
    return 0;
  }else if(N==2&&M==2){
    cout<<2<<endl;
    return 0;
  }else{   
    cout<<N*(N-1)/2+M*(M-1)/2<<endl;
  }
  return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m;
	cin>>n>>m;
	
	cout<<((n*n-1)/2)+((m*m-1)/2);
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m;
	cin>>n>>m;
	
	cout<<((n*n-1)/2)+((n*n-1)/2);
}
//  [cpp]
#include<stdio.h>
int main(){
  int M, N;
    scanf("%d %d", &M, &N);
  int a=1;
  int b=1;
  //int b=1;
  int genap, ganjil;
  int arraygenap[M], arrayganjil[N];
  int z=0;
  
  for(int i=1; i<=M; i++){
    genap= 2*a;
    arraygenap[i]=genap;
    a++;  
  }
  getchar();
  for(int i=1; i<=N; i++){
    ganjil= 3*b;
    arrayganjil[i]=ganjil;
    b++;
  }
  for(int i=0; i<M; i++){
    for(int x=0; x<N; x++){
         if((arrayganjil[i]+arraygenap[x])%2==0){
           z=i+x;
         }else{}
       
    }
  }
    printf("%d", z);
    return 0;
  }
//  [c]
#include<stdio.h>
 
int main(){
  int n,m;
  
  scanf("%d %d",&n, &m);
  printf("%d\n", (n+m)*(n+m-1)/2-n*m);
  return 0;
}
//  [c]
#include<stdio.h>

int main(){
	int N;
	scanf("%d", &N);
	int M;
	scanf("%d", &M);
	int n_even = (N * (N - 1)) / 2;
	int n_odd = (M * (M - 1)) / 2;
	
	if(N == 0 && M > 0)
		printf("%d", n_odd);
	else if(M == 0 && N > 0)
		printf("%d", n_even);
	else
		printf("%d", n_odd + n_even);
	return 0;
}
//  [c]
#include <stdio.h>

int main(){
	int N,M;
  	scanf("%d %d", &N, &M);
  
  	int ans;
  	ans = N*(N-1)/2 + M*(M-1)/2;
      
    printf("%d",ans);
}
//  [c]
#include <stdio.h>
int main(){
	int a, b, n, sum=0;
	scanf("%d", &a);
	for(int i=0; i<a; i++){
		scanf("%d", &n);
    	while(n>0){
    	b=n%10;
		n=n/10;
		sum+=b;
		}
		printf("%d\n", sum);
	}
return 0;
}
//  [c]
#include <stdio.h>

int main(){
	int N; int even = 0;
	int M; int odd = 0;
	scanf ("%d %d", &N, &M);
	
	for (int i=0; i <= N; i++){
		even = even +i-1; 
	}
	for(int i=0; i <= M; i++){
		odd = odd +i-1;
	}
	printf ("%d", odd+even);
	
	
	return 0;
}
//  [c]
#include<stdio.h>

int main () 
{

  int n,m;
  
  scanf("%d %d",&n,&m);
  
  printf("%d",comb(n,2)+comb(m,2));

}

int comb(int a,int b)
{
  int i;
  int fact1=1;
  int fact2=1;
  int fact3=1;
  
  for(i=1;i<=a;i++)
  {
  fact1=fact1*i;
   // fact1=fact1 % modb;
   // printf("%d\n",fact1);
  }
  for(i=1;i<=b;i++)
  {
  fact2=fact2*i;
  //  fact2=fact2 % modb;
  }
  for(i=1;i<=a-b;i++)
  {
  fact3=fact3*i;
   // fact3=fact3 % modb;
  }
  
  return (fact1/fact2/fact3);
}
//  [javascript]
function Main(input) {
    var tmp = input.split(" ");
    var N = parseInt(tmp[0],10);
    var M =parseInt(tmp[1],10);

    //組み合わせの考え方
    //偶数＋偶数＝偶数(1)
    //奇数＋偶数＝奇数(2)
    //奇数＋奇数＝偶数(3)
    //であるため
    //(1)=N*(N-1),(3)=M*(M-1)の和が
    //N+Mのボールから任意の2のボールを取るときの偶数となる場合の数となる。
    
        console.log((N*(N-1)+M*(M-1))/2);
    
    

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const s_list = require('fs').readFileSync('/dev/stdin', 'utf8').split(' ');
const n_list = s_list.map(s => parseInt(s, 10));
const n = n_list[0];
const m = n_list[1];

const ans_n = n > 1 ? n * (n - 1) / 2 : 0
const ans_m = m > 1 ? m * (m - 1) / 2 : 0
const ans = ans_n + ans_m
console.log(ans)
//  [javascript]
'use strict';
function main(input) {
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);

  const sum = (a > 1 ? a * (a - 1) / 2 : 0) + (b > 1 ? b * (b - 1) / 2 : 0)

  console.log(sum);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
	var str = input;
	var ans = 0;
	var str = str.split("\n")[0];
	var num = str.split(" ");
	var n = Number(num[0]);	
	var m = Number(num[1]);	
	
	if(n >1){
		n = n*(n-1)/2;
	}
	if(m>1){
		m = m*(m-1)/2;
	}
	ans = n+m;
		console.log(ans);
	}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict';
function main(input) {
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);

  sum = (a > 1 ? a * (a - 1) / 2 : 0) + (b > 1 ? b * (b - 1) / 2 : 0)

  console.log(sum);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    var tmp = input.split(" ");
    var L = parseInt(input,10);
    

    //-input
    //L=正の整数

    //-output
    //L=x+y+zを満たす直方体の体積S=x*y*z

    console.log(Math.pow(L/3,3));



}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)

	n := nextInt()
	m := nextInt()

	gg := 0 // 偶数+偶数
	kk := 0 // 奇数+奇数

	if n >= 2 {
		gg = n * (n - 1) / 2
	}
	if m >= 2 {
		kk = m * (m - 1) / 2
	}

	fmt.Println(gg + kk)

}

// ---- readfunc
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var stdInScanner = bufio.NewScanner(os.Stdin)

func nextInt() int {
	stdInScanner.Scan()
	i, _ := strconv.Atoi(stdInScanner.Text())
	return i
}

func main() {
	stdInScanner.Split(bufio.ScanWords)

	N := nextInt()
	M := nextInt()

	// 全て偶数(nC2)
	a := (N * (N - 1)) / 2
	// すべて奇数(mC2)
	b := (M * (M - 1)) / 2
	fmt.Println(a + b)
}
//  [go]
package main

import (
	"fmt"
)

func combinationTwo(a int)int{
	return a * (a-1) / 2
}

func main() {
	var even, odd int
	fmt.Scan(&even, &odd)
	// even2個、odd2個で偶数になる
	// even C 2 + odd C 2の組み合わせが答え

	ans := 0
	if even >= 2 && odd >= 2{
		ans = combinationTwo(even) + combinationTwo(odd)
	}else if even >= 2 && odd < 2{
		ans = combinationTwo(even)
	}else if even < 2 && odd >= 2{
		ans = combinationTwo(odd)
	}

	fmt.Println(ans)
}
//  [go]
#include <bits/stdc++.h>
using namespace std;
int main () {
  int n, m;
  cin >> n >> m;
  cout << ((n * (n-1) + m * (m-1)) / 2) << "\n";
}
//  [go]
package main
import (
    "fmt"
)

func main(){
    var n, m int
    fmt.Scanf("%d:%d", &n, &m);
    ans := n * (n - 1) / 2 + m * (m - 1)
    fmt.Println(ans)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"reflect"
	"strings"
)

// 元の文字列と逆順にした文字列、そして回文かどうかを真偽値で返す
func GetPalindrome(slice []string) bool {
	sre := make([]string, 0)

	for i := len(slice) - 1; i >= 0; i-- {
		sre = append(sre, slice[i])
	}
	if reflect.DeepEqual(slice, sre) {
		return true
	}
	return false
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()

	scan := scanner.Text()

	slice := strings.Split(scan, "")

	if len(slice) < 7 {
		fmt.Println("No")
		os.Exit(0)
	}

	flag := GetPalindrome(slice)

	if flag == false {
		fmt.Println("No")
		os.Exit(0)
	}

	flag = GetPalindrome(slice[:(len(slice)-1)/2])

	if flag == false {
		fmt.Println("No")
		os.Exit(0)
	}

	flag = GetPalindrome(slice[((len(slice)+3)/2)-1:])

	if flag == false {
		fmt.Println("No")
		os.Exit(0)
	}

	fmt.Println("Yes")

}
//  [ruby]
n, m = gets.split.map(&:to_i)

puts n*(n-1) / 2 + m*(m-1) / 2
//  [ruby]
a,b = gets.split.map(&:to_i)
puts (a * (a-1) / 2) + (b * (b-1) / 2)
//  [ruby]
n,m = gets.split.map(&:to_i)
puts (n*(n-1) + m*(m-1))/2
//  [ruby]
n,m = gets.chomp.split(' ').map(&:to_i)
puts ((m + n)*(m + n - 1) - m * (m - 1)) / 2
//  [ruby]
n,m = gets.chomp.split(' ').map(&:to_i)
puts ((m + n)*(m + n - 1) - n * (n - 1)) / 2
//  [ruby]
x,y=gets.split.map!(&:to_i)
ans1=0
ans2=0
if x>2
  for i in 1..x-1
    ans1+=i
  end
else
  ans1=x-1
end
if y>2
  for j in 1..y-1
    ans2+=j
  end
else
  ans2=y-1
end
puts ans1+ans2
//  [rust]
/* {{{ */
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
/* }}} */

fn main() {
    input! {
        n: u32,
        m: u32
    }
    println!("{}",
        n * (n-1) / 2 +
        m * (m-1) / 2);
}
/* vim:set foldmethod=marker: */
//  [rust]
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

use std::iter::Iterator;

fn main() {
    input! {
        N: usize,
        M: usize,
    }

    let mut  n = N;

    if N == 0 {
        n = 1
    }

    let mut m = M;

    if M == 0 {
        m = 1
    }

    println!("{}", (m* (m-1) + n*(n-1))/2);
  
    
}
//  [rust]
// https://atcoder.jp/contests/abc159/tasks/abc159_a

use proconio::input;

fn main() {
    input! { n: i8, m: i8, }
    println!("{}", n * (n - 1) / 2 + m * (m - 1) / 2);
}
//  [rust]
use proconio::input;
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};

#[allow(non_snake_case)]
fn main() {
    input! {
        N:usize,
        M:usize,
    }
    let mut ans = 0;
    if N > 0 {
        ans += N * (N - 1) / 2;
    }
    if M > 0 {
        ans += M * (M - 1) / 2;
    }
    println!("{}", ans);
}
//  [rust]
use proconio::input;


fn main() {

    input! {
        n: i32,
        m: i32,
    };

    let na = (n*(n-1)) / 2;
    let nb = (m*(m-1)) / 2;

    print!("{}", na+nb);
}
//  [swift]
import Foundation
let array = readLine()!.componentsSeparatedByString(" ").map{ Int($0)! }
var a = Int(array[0])
var b = Int(array[1])
var c = a*(a-1)/2 + b*(b-1)/2
print(c)
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let line = readInts()
    let n = line[0]
    let m = line[1]
    
    print(n * (n - 1) / 2 + m * (m - 1) / 2)
}

main()
//  [swift]
import Foundation
 
let split = readLine()!.componentsSeparatedByString(" ")
 
let N = Int(split[0])!
let M = Int(split[1])!
let combination = (N * (N - 1) / 2) + (M * (M - 1) / 2)
print(combination)
//  [swift]
import Foundation
let array = readLine()!.componentsSeparatedByString(" ").map{ Int($0)! }
var a = Int(array[0])!
var b = Int(array[1])!
var c = a*(a-1)/2 + b*(b-1)/2
print(c)
//  [swift]
import Foundation
let array = readLine()!.componentsSeparatedByString(" ").map{ Int($0)! }
var a = int(array[0])
var b = int(array[1])
var c = a*(a-1)/2 + b*(b-1)/2
print(c)
//  [swift]
import Foundationimport Foundation
let input = readLine()!.componentsSeparatedByString(" ")
let N = Int(input[0])!
let M = Int(input[1])!

let sum = N * (N - 1) / 2 + M * (M - 1) / 2
print(sum)
//  [typescript]
export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const [n, m]: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    return `${((n + m) * (n + m - 1) / 2) - (n * m)}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
function main(input) {
  const inputs =input.split('\n')
  const [N, M] = inputs[0].split(' ').map(Number)
  console.log(
    (N + M) * (N + M -1) / 2 - (N * M)
  )
  
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
class NormalInput {
  input: string[];
  pointer: number;
  constructor(raw: string) {
    this.input = raw.split(/ |\n/);
    this.pointer = 0;
  }
  int = (): number => {
    const ret = parseInt(this.input[this.pointer], 10);
    this.pointer++;
    return ret;
  };
  str = (): string => {
    const ret = this.input[this.pointer];
    this.pointer++;
    return ret;
  };
  strs = (length: number): string[] => {
    let ret: string[] = [];
    for (let i = 0; i < length; i++) {
      ret.push(this.str());
    }
    return ret;
  };
  ints = (length: number): number[] => {
    let ret: number[] = [];
    for (let i = 0; i < length; i++) {
      ret.push(this.int());
    }
    return ret;
  };
}

function Main({ int, str, strs, ints }: NormalInput) {
  const [N,M ]= ints(2);
  console.log(N*(N-1)/2+M*(M-1)/2);
}

//DO NOT EDIT
Main(new NormalInput(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
function Main(input: string) {
  const length = input.length;
  const a = check(input);
  const b = check(input.substr(0, (length  -1)/2 ));
  const c = check(input.substr((length +3)/2 - 1))
  console.log(a && b && c ? 'Yes': 'No');
}


function check(str: string) {
  const length = str.length;
  for (let i = 0; i < Math.floor(length / 2); i++) {
    if (str.charAt(i) !== str.charAt(length - i - 1))return false;
  }
  return true;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
function Main(input: string) {
  const length = input.length ;
  const a = check(input);
  const b = check(input.slice(0, (length  -1)/2 ));
  const c = check(input.slice((length +3)/2 -1, length ))
  console.log(a && b && c ? 'Yes': 'No');
}


function check(str: string) {
  const length = str.length;
  for (let i = 0; i < length / 2; i++) {
    if (str.charAt(i) !== str.charAt(length - i - 1))return false;
  }
  return true;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
import math
n = int(input())
a =[int(input()) for _ in range(5)]
print(math.ceil(n / min(a)) + 4)
//  [python]
# -*- coding: utf-8 -*-
import math

# スペース区切りの整数の入力
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

bottle_neck=min(A,B,C,D,E)

ans= 4 + math.ceil(N/bottle_neck)

print(ans)
//  [python]
n = int(input())
data = [int(input()) for i in range(5)]
bn = min(data)
print(-(-n//bn)+4)
//  [python]
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=min(a,b,c,d,e)
print(n//k + 5)
//  [python]
n=int(input())
t=[int(input()) for i in range(5)]
k=0
for i in range(5):
    k=max(k,(n//t[i]))
print(5+k)
//  [python]
N = int(input())
T = []
for i in range(5):
    T.append(int(input()))
k = 0
for i in range(4):
    if N % T[i] == 0:
        k = max(k, N//T[i])
    else:
        k = max(k, N//T[i] + 1)
print(4 + k)
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;


public class Main {
    long[] a;
    long N;
    private void solve() {
        N = nextLong();

        a = new long[5];
        long min = Long.MAX_VALUE;
        for(int i = 0;i < 5;i++) {
            a[i] = nextLong();
            min = Math.min(min, a[i]);
        }

        long ans = 5;
        N = Math.max(N - min, 0);
        ans += N / min;
        ans += (N % min > 0 ? 1 : 0);
        out.println(ans);

    }

    public static void main(String[] args) {
        out.flush();
        new Main().solve();
        out.close();
    }

    /* Input */
    private static final InputStream in = System.in;
    private static final PrintWriter out = new PrintWriter(System.out);
    private final byte[] buffer = new byte[4096];
    private int p = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (p < buflen)
            return true;
        p = 0;
        try {
            buflen = in.read(buffer);
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (buflen <= 0)
            return false;
        return true;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrint(buffer[p])) {
            p++;
        }
        return hasNextByte();
    }

    private boolean isPrint(int ch) {
        if (ch >= '!' && ch <= '~')
            return true;
        return false;
    }

    private int nextByte() {
        if (!hasNextByte())
            return -1;
        return buffer[p++];
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = -1;
        while (isPrint((b = nextByte()))) {
            sb.appendCodePoint(b);
        }
        return sb.toString();
    }

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

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

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}
//  [java]

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	static int[][] memo;

	public static int hoge(int current, int n, String last) {
		return 0;
	}

	public static void main(String[] args) throws IOException {
		BufferedReader bf = null;
		bf = new BufferedReader(new InputStreamReader(System.in));
		long a,b,c,d,e,n,ans = 0;
		String str;
		str = bf.readLine();
		n = Long.parseLong(str);
		str = bf.readLine();
		a = Long.parseLong(str);
		long temp = a;
		str = bf.readLine();
		b = Long.parseLong(str);
		if(temp > b) {
			temp = b;
		}
		str = bf.readLine();
		c = Long.parseLong(str);
		if(temp > c) {
			temp = c;
		}
		str = bf.readLine();
		d = Long.parseLong(str);
		if(temp > d) {
			temp = d;
		}
		str = bf.readLine();
		e = Long.parseLong(str);
		if(temp > e) {
			temp = e;
		}
		ans = n/temp + 4;
		if(n%temp != 0) {
			ans++;
		}
		System.out.println(ans);
	}
}
//  [java]
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        ArrayList<Long> list = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            list.add(sc.nextLong());
        }
        long min = Collections.min(list);
        if(min >= n) {
            System.out.println(5);
        } else {
            long tmp = (n % min) % 2;
            long ans = 0;
            if(tmp != 0) {
                ans = (n / min) + 5;
            } else {
                ans = (n / min) + 4;
            }
            System.out.println(ans);
        }
    }
}
//  [java]
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        ArrayList<Long> list = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            list.add(sc.nextLong());
        }
        long min = Collections.min(list);
        if(min >= n) {
            System.out.println(5);
        } else {
            long ans = (n / min) + 5;
            System.out.println(ans);
        }
    }
}
//  [java]

import java.util.*;

public class Main {

	public static void main(String[] args) {

		// 入力
		Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
		long a[];
		a = new long[5];
		a[0] = Long.parseLong(sc.next());
		a[1] = Long.parseLong(sc.next());
		a[2] = Long.parseLong(sc.next());
		a[3] = Long.parseLong(sc.next());
		a[4] = Long.parseLong(sc.next());

		// 最も輸送人数の少ない乗り物の、輸送人数をminとする
		long min = a[0];
		for (int i = 1; i <= 4; i++) {
			if (a[i] < min) {
				min = a[i];
			}
		}

		// min人ずつ流すので
		System.out.println((n / min) + 5);

	}

}
//  [cpp]
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int GCD(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   if(_a % _b == 0){
      return _b;
   }
   else{
      return GCD(_b, _a % _b);
   }
}

int LCM(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   return (_a*_b)/(GCD(_a, _b));
}

int main(){
   long long n;
   array<long long, 5> x;
   cin >> n;
   for(int i = 0; i < x.size(); i++){
      cin >> x[i];
   }
   long long min_x = *min_element(x.begin(), x.end());
   cout << (n + min_x - 1)/min_x + 4  << endl;
   return 0;
}
//  [cpp]
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<string>
#include<cstring>
#define ll long long
#define sci(a) scanf("%d",&a)
#define scl(a) scanf("%I64d",&a)
#define scs(a) scanf("%s",a)
#define pri(a) printf("%d",a)
#define prl(a) printf("%I64d",a)
#define prc(a) printf("%c",a)
const int N=1e5+5;
const int M=1e5+5;
const ll INF=1e15+7;
const double PI=acos(-1);
using namespace std;
ll n,a[10];
int main(){
	cin>>n;
	for(int i=0;i<5;++i) cin>>a[i];
	ll small=INF;
	for(int i=0;i<5;++i) if(small>a[i]) small=a[i];
	ll ans=4;
	ans+=n/small;
	if(n%small!=0) ans++;
	cout<<ans;
}
//  [cpp]
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<string>
#include<cstring>
#define ll long long
#define sci(a) scanf("%d",&a)
#define scl(a) scanf("%I64d",&a)
#define scs(a) scanf("%s",a)
#define pri(a) printf("%d",a)
#define prl(a) printf("%I64d",a)
#define prc(a) printf("%c",a)
const int N=1e5+5;
const int M=1e5+5;
const ll INF=1e15+7;
const double PI=acos(-1);
using namespace std;
ll n,a[10];
int main(){
	scanf("%lld",&n);
	for(int i=0;i<5;++i) scanf("%lld",&a[i]);
	ll small=INF;
	for(int i=0;i<5;++i) if(small>a[i]) small=a[i];
	ll ans=4;
	ans+=n/small;
	if(n%small!=0) ans++;
	printf("%lld",ans);
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
using pp=pair<int,int>;
using ll=long long;

int main() {
  ll N;
  cin >> N;
  vector<ll> V(5);
  for (int i=0; i<5; i++) {
    cin >> V[i];
  }
  ll S=0;
  
  int Ve=V[0];
  for (int i=1; i<5; i++) {
    if (V[i]<Ve) {
      Ve=V[i];
    }
  }

  cout << (N-1)/Ve+5 << endl;
  
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
using pp=pair<int,int>;
using ll=long long;

int main() {
  ll N;
  cin >> N;
  vector<ll> V(5), E(1,0);
  for (int i=0; i<5; i++) {
    cin >> V[i];
  }
  ll S=0;
  
  int Ve=V[0];
  for (int i=1; i<5; i++) {
    if (V[i]<Ve) {
      E.push_back(i);
      Ve=V[i];
    }
  }
  E.push_back(5);
  
  
  
  //S+=(N-1)/V[i]+1+1;
  for (int i=1; i<E.size(); i++) {
    S+=E[i]-E[i-1]-1+((N-1)/V[E[i-1]]+1);
    //cout << S << endl;
    if (i>1) {S--;}
  }
  cout << S << endl;
  
}
//  [cpp]
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(I, a, b) for (int i = (a); i < (b); ++i)
using namespace std;
using ll = long long;

int main() {
  ll n,a,b,c,d,e;
  cin >> n >> a >> b >> c >> d >> e;
  ll w = min({a,b,c,d,e});
  ll pls;
  if(n <= w){
    cout << 5 << endl;
    return 0;
  }
  ll ans = n/w;
 
  ans += 5;
  cout << ans << endl;
}
//  [c]
long long n,x,i,ans;main(){
scanf("%lld%lld",&n,&x);
ans=(n-1)/x;
for(i=0;i<4;i++){scanf("%lld",&x);ans=(ans>(n-1)/x?ans:(n-1)/x); }
printf("%lld",5+ans);}
//  [c]
#include <stdio.h>
long long n,x,i,ans;
int main(){
scanf("%lld%lld",&n,&x);
ans=(n-1)/x;
for(i=0;i<4;i++){scanf("%lld",&x);ans=(ans>(n-1)/x?ans:(n-1)/x); }
printf("%lld",5+ans);
return 0;
}
//  [c]
#include <malloc.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

//ABC123C
int main(void) {
  int i;
  long long n, abc[5], min=1e15;
  scanf("%lld", &n);
  for(i=0; i<5; i++){
    scanf("%lld", &abc[i]);
    min=min>abc[i] ? abc[i] : min;
  }
  printf("%lld", 5+(n-1)/min);
}
//  [c]
#include<stdio.h>
int main(void){
	
	unsigned long long int a[5],k,i,x,o=0,m=0;
	
	scanf("%d",&k);
	scanf("%d",&a[0]);
	scanf("%d",&a[1]);
	scanf("%d",&a[2]);
	scanf("%d",&a[3]);
	scanf("%d",&a[4]);
	
	for(i=0;i<5;i++){
		x=(k/a[i]);
		if(x>o){
			m+=(x-o);
			o=x;
		}
	}
	m+=5;
	printf("%d",m);
	return(0);
}
//  [c]
#include<stdio.h>
int main(void){
	
	unsigned int a[5],k,i,x,o=0,m=0;
	
	scanf("%d",&k);
	scanf("%d",&a[0]);
	scanf("%d",&a[1]);
	scanf("%d",&a[2]);
	scanf("%d",&a[3]);
	scanf("%d",&a[4]);
	
	for(i=0;i<5;i++){
		x=(k/a[i]);
		if(x>o){
			m+=(x-o);
			o=x;
		}
	}
	m+=5;
	printf("%d",m);
	return(0);
}
//  [c]
#include<stdio.h>
int main(void){
	
	unsigned int a[5],k,i,x,o=0,m=0;
	
	scanf("%d",&k);
	scanf("%d",&a[0]);
	scanf("%d",&a[1]);
	scanf("%d",&a[2]);
	scanf("%d",&a[3]);
	scanf("%d",&a[4]);
	
	for(i=0;i<5;i++){
		x=(k/a[i])+1;
		if(x>o){
			m+=(x-o);
			o=x;
		}
	}
	m+=4;
	printf("%d",m);
	return(0);
}
//  [javascript]
function main(x) {
    console.log(4+Math.ceil(x[0]/Math.min(x[1],x[2],x[3],x[4],x[5])));
}
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));
//  [javascript]
function Main(input){
  var data = input.split("\n");
  var move = Math.min(data[1], data[2], data[3], data[4], data[5]);
  console.log(Math.ceil(data[0]/move)+4);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    tmp = input.split("\n");
    tmp = tmp.map(Number);
    
    N = tmp[0];
    m = Math.min(tmp[1],tmp[2],tmp[3],tmp[4],tmp[5]);
    answer = 4 + Math.ceil(N/m);
    console.log(answer);
    
    
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  const formatted_input = input.split('\n').map(x => parseInt(x));

  const N = formatted_input[0];
  var necks = [];
  for(var i=1;i<=5;i++){
    necks.push(formatted_input[i]);
  }
  const bottle_neck = Math.min(...necks);
  const bottle_neck_time = Math.floor(N/bottle_neck)+1;

  var result = 4 + bottle_neck_time;

//  console.log(N);
//  console.log(bottle_neck);
//  console.log(bottle_neck_time);
  console.log(result);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function MainC(input) {
	input = input.split("\n");
	var n = input.shift();
	var min = Infinity;	
　for(var i = 0; i < 5; i++){
		if( input[i] < min){
			min = input[i];
		}
	}
  var totalTime = Math.ceil(n / min) + 4;

	console.log('%d',totalTime);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
MainC(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input){
  tile = input.split('')
  changeCount = 0
  changeFlag = false
  for (let index = 1; index < tile.length; index++) {
    if(tile[index] == tile[index-1] && !changeFlag){
      changeFlag = true
      changeCount ++
    }
    else if(tile[index] != tile[index-1] && changeFlag){
      changeCount ++
    }else{
      changeFlag = false
    }
    return;
  }

  }
  Main(require("fs").readFileSync("/dev/stdin","utf-8"));
//  [go]
package main

import (
	"fmt"
)

func main() {

	var N uint64
	var A[5] uint64

	fmt.Scanf("%v", &N)
	fmt.Scanf("%v", &A[0]) // 0 -> 1
	fmt.Scanf("%v", &A[1]) // 0 -> 1
	fmt.Scanf("%v", &A[2]) // 0 -> 1
	fmt.Scanf("%v", &A[3]) // 0 -> 1
	fmt.Scanf("%v", &A[4]) // 0 -> 1

	num := make([]uint64, 6)
	num[0] = N

	minIdx := 0
	min := A[0]
	for i := 1; i < 5; i++ {
		if A[i] < min {
			min = A[i]
			minIdx = i
		}
	}
	// minの左までを足す
	var t uint64
	for i := 0; i < minIdx; i++ {
		t ++
	}
	// minの分を足す
	t += N / A[minIdx]
	if N % A[minIdx] != 0 {
		t++
	}
	// minの右を足す
	for i := minIdx + 1; i < 5; i++ {
		t ++
	}
	fmt.Printf("%v\n", t)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func swap(a int64, b int64) (int64, int64) {
	return b, a
}

func gcd(a int64, b int64) int64 {
	if b > a {
		a, b = swap(a, b)
	}
	if b == 0 {
		return a
	} else {
		return gcd(a%b, b)
	}
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func min(nums ...int64) int64 {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int64(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int64) int64 {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int64(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func nextLong() int64 {
	sc.Scan()
	i, e := strconv.ParseInt(sc.Text(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

func nextString() string {
	sc.Scan()
	s := sc.Text()
	return s
}

func main() {
	sc.Split(bufio.ScanWords)
	N := nextLong()
	A := nextLong()
	minnum := A
	B := nextLong()
	minnum = min(minnum, B)
	C := nextLong()
	minnum = min(minnum, C)
	D := nextLong()
	minnum = min(minnum, D)
	E := nextLong()
	minnum = min(minnum, E)
	ans := int64(math.Ceil(float64(N)/float64(minnum)) + 4)
	fmt.Printf("%d\n", ans)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"sort"
	"strconv"
)

func main() {
	N := readi()
	A := readi()
	B := readi()
	C := readi()
	D := readi()
	E := readi()

	t := []int{A, B, C, D, E}
	sort.Ints(t)

	tmp := int(math.Ceil(float64(N) / float64(t[0])))

	fmt.Println(4 + tmp)
}

/*-------------------utilities-------------------*/

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func chmin(x *int, y int) bool {
	if *x > y {
		*x = y
		return true
	}
	return false
}

func chmax(x *int, y int) bool {
	if *x < y {
		*x = y
		return true
	}
	return false
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func lcm(a, b int) int {
	return (a * b) / gcd(a, b)
}

func permutations(arr []int) [][]int {
	var helper func([]int, int)
	res := [][]int{}

	helper = func(arr []int, n int) {
		if n == 1 {
			tmp := make([]int, len(arr))
			copy(tmp, arr)
			res = append(res, tmp)
		} else {
			for i := 0; i < n; i++ {
				helper(arr, n-1)
				if n%2 == 1 {
					tmp := arr[i]
					arr[i] = arr[n-1]
					arr[n-1] = tmp
				} else {
					tmp := arr[0]
					arr[0] = arr[n-1]
					arr[n-1] = tmp
				}
			}
		}
	}
	helper(arr, len(arr))
	return res
}

func isPrime(n int) bool {
	if n == 1 {
		return false
	}
	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			return false
		}
	}
	return true
}

func divisor(n int) (res []int) {
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			res = append(res, i)
			if i*i != n {
				res = append(res, n/i)
			}
		}
	}
	sort.Ints(res)
	return
}

/*-------------------init-------------------*/

const (
	INF = 1000000000000000000
	MOD = 1e9 + 7
)

var (
	readString func() string
)

func init() {
	readString = newReadString(os.Stdin)
}

/*-------------------inputs-------------------*/

func readi() int {
	return int(readi64())
}

func readi64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readf() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}
//  [go]
package main

import (
	"fmt"
)


func main() {
	var n int
	fmt.Scan(&n)

	min := int(1e16)
	for i := 0 ; i < 5; i++{
		var a int
		fmt.Scan(&a)
		if min > a {
			min = a
		}
	}

	fmt.Println(n/min + 5)


}
//  [ruby]
n = gets.to_i
a = gets.to_i
b = gets.to_i
c = gets.to_i
d = gets.to_i
e = gets.to_i

bottleneck = [a, b, c, d, e].min

bottleneck_count, mod = n.divmod(bottleneck)
bottleneck_count += 1 unless mod.zero?

puts bottleneck_count + 4
//  [ruby]
N = gets.to_i
A = gets.to_i
B = gets.to_i
C = gets.to_i
D = gets.to_i
E = gets.to_i
time_list = [A,B,C,D,E]
min = time_list.min
min_index = time_list.index(min)
puts (N/min) + (N%min==0 ? 0 : 1) + 4-min_index + min_index
//  [ruby]
n = gets.chomp.to_f
tptt = []
5.times do
  tptt.push(gets.chomp.to_i)
end

p (n / tptt.min).ceil + 4
//  [ruby]
N = gets.to_i
AE = 5.times.map{|_| gets.to_i}

min = AE.min
p N / min + 5
//  [ruby]
n = gets.to_i
array = []
5.times do
  array << gets.to_i
end

x = n % array.min

if n < array.min
  puts 5
else
  puts ceil(x + 4)
end
//  [ruby]
n = gets.to_i
array = []
5.times do
  array << gets.to_i
end

x = n % array.min

if n < array.min
  puts 5
else
  puts x + 4
end
//  [rust]
fn main() {
    let n = read::<usize>();
    let mut abcde: Vec<usize> = vec![0; 5];
    let mut idx = 0;
    let mut mi = usize::max_value();
    for i in 0..5 {
        let tmp = read::<usize>();
        if mi > tmp {
            mi = tmp;
            idx = i;
        }
    }

    let ret = if n % mi == 0 {
        (n / mi)
    } else {
        (n / mi) + 1
    };
    println!("{}", ret + 4);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().parse().ok().unwrap()
}
//  [rust]
use std::io::Read;
use std::cmp::min;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();
    let mut min_capacity: usize = iterator.next().unwrap().parse().unwrap();
    min_capacity = min(min_capacity, iterator.next().unwrap().parse().unwrap());
    min_capacity = min(min_capacity, iterator.next().unwrap().parse().unwrap());
    min_capacity = min(min_capacity, iterator.next().unwrap().parse().unwrap());
    min_capacity = min(min_capacity, iterator.next().unwrap().parse().unwrap());

    if min_capacity >= n {
        return "5".to_string()
    }

    if n % min_capacity == 0 {
        return format!("{}", 5 + (n / min_capacity - 1));
    }

    return format!("{}", 5 + (n / min_capacity));
}
//  [rust]
#![allow(unused_macros)]

// cf. [Rustで競技プログラミングの入力をスッキリ記述するマクロ - Qiita](https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8)
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        N: usize,
        A: usize,
        B: usize,
        C: usize,
        D: usize,
        E: usize,
    }
    let &m = [A, B, C, D, E].into_iter().min().unwrap();
    println!("{}", 4 + (N as f64 / m as f64).ceil() as usize);
}
//  [rust]
use num_bigint::BigInt;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars, Usize1};
use proconio::{fastout, input};
#[fastout]
fn main() {
    input! {
        n: BigInt,
        a: BigInt,
        b: BigInt,
        c: BigInt,
        d: BigInt,
        e: BigInt,
    }
    let mut array = [a, b, c, d, e];
    array.sort();
    let min = &array[0];

    println!("{}", n / min + 5);
}
//  [rust]
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars, Usize1};
use proconio::{fastout, input};
#[fastout]
fn main() {
    input! {
        n: usize,
        a: usize,
        b: usize,
        c: usize,
        d: usize,
        e: usize,
    }
    let mut array = [a, b, c, d, e];
    array.sort();

    println!("{}", n / array[0] + 5);
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main(){

    input!{
        n: usize,
        route: [usize;5],
    }

    let mut min_value = route[0];
    for i in route {
        min_value = std::cmp::min(min_value, i);
    }

    let ans = 4 + n/min_value + 1;
    
    println!("{}", ans);

}
//  [swift]
var i:Int{return Int(readLine()!)!};let N=i,n=[i,i,i,i,i].minElement()!;print(4+(N+n-1)/n)
//  [swift]
var i:Int{return Int(readLine()!)!};let N=i,n=min(i,i,i,i,i);print(4+(N+n-1)/n)
//  [swift]
var i:Int{return Int(readLine()!)!}
let N = i
let n = [i,i,i,i,i].minElement()!
print(4+(N+n-1)/n)
//  [swift]
import Foundation

class City {
    
    private let delay: Int
    private let initial: Int
    private let output: Int
    private let prev: City?
    
    init(delay: Int, initial: Int, output: Int, prev: City?) {
        self.delay = delay
        self.initial = initial
        self.output = output
        self.prev = prev
    }
    
    func outputPerMin() -> Int {
        if let prev = prev {
            return min(prev.outputPerMin(), output)
        } else {
            return output
        }
    }
    
    func outputTimes() -> Int {
        var sum = initial
        if let prev = prev {
            sum += prev.outputPerMin() * prev.outputTimes()
        }
        let output = outputPerMin()
        return Int(ceil(Double(sum) / Double(output)))
    }
    
    func totalTime() -> Int {
        return delay + outputTimes()
    }
}

let N = Int(readLine()!)!

var cities: [City] = []
var prev: City?
for i in 0 ..< 5 {
    let output = Int(readLine()!)!
    let city = City(
        delay: i,
        initial: i == 0 ? N : 0,
        output: output,
        prev: prev)
    cities.append(city)
    prev = city
}

let answer = cities.last!.totalTime()

print(answer)
//  [swift]
var i:Double{return Double(readLine()!)!};print(4+Int(i/min(i,i,i,i,i)+0.999))
//  [swift]
var i:Double{return Double(readLine()!)!};print(4+Int(i/min(i,i,i,i,i)+0.99))
//  [typescript]
export class Main {
  static main(input): string {
    const [n, a, b, c, d, e]: number[] = input.split("\n").map(s => Number(s.split(" ")[0]));
    const m: number = Math.min(a, b, c, d, e);
    const r: number = n % m;
    let result: number = 0;
    if (r == 0) {
      result = n / m;
    } else {
      result = (n - r) / m + 1;
    }
    return `${result + 4}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
const input = require('fs').readFileSync('/dev/stdin', 'utf8')

const [n, a, b, c, d, e] = input.split('\n').map(Number)
const min = Math.min(a, b, c, d, e)
if (n % min === 0) {
  console.log(Math.floor(n / min) + 4)
}
else {
  console.log(Math.floor(n / min) + 5)
}