public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] a = new int[n + 1]; int[] data = {0, 1, 2, 4, 5, 10}; for (int i = 1; i <= n; i++) a[i] = i; for (int i = 1; i <= n; i++) for (int j = 1; j <= 5; j++) if (data[j] <= i) a[i] = Collections.min(Arrays.asList(a[i], a[i - data[j]] + 1)); System.out.println(a[n]); } }