jiahuimbzuai/CoQuIR huggingface dataset:
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

K, X = get_ints

puts (X - K + 1).step(X + K - 1).map { _1 }.join(' ')
//  [ruby]
k, x = gets.chomp.split.map(&:to_i)

min = [x - k, -1000000].max
max = [x + k,  1000000].min

puts (max - min - 1).times.map { |x| min + x + 1 }.join(' ')
//  [ruby]
k,x = gets.chomp.split(' ').map(&:to_i)
puts ((x-k+1)..(x+k-1)).to_a.join(' ')
//  [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),*);
    }
}

fn f(s: &[char]) -> bool {
    let m = s.len();
    for i in 0..m {
        if s[i] != s[m - 1 - i] {
            return false;
        }
    }
    true
}

use std::iter::Iterator;
use std::cmp;

fn main() {
    input! {
        k : i32,
        x : i32,
    }

    let mut min = x - k + 1;
    if min < -1000000 { min = -1000000}

    let mut max = k + x - 1;
    if max > 1000000 { max = 1000000}

    let ans = (min..max + 1).map(|x| x.to_string()).collect::<Vec<_>>().join(" ");

    println!("{}", ans);

}
//  [rust]
use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let mut iter = buf.split_whitespace();
	let k:i32 = match iter.next().unwrap().parse() {
		Ok(n) => n,
		Err(_) => panic!(""),
	};
	let x:i32 = match iter.next().unwrap().parse() {
		Ok(n) => n,
		Err(_) => panic!(""),
	};
	for n in (x-k+1)..(x+k) {
		print!("{} ", n);
	}
	print!("\n");
}
//  [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! {
        k: i32,
        x: i32
        
    }
    for i in (x-k+1)..(x+k) {
        print!("{} ", i);
    }
}
/* vim:set foldmethod=marker: */
//  [rust]
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let v = read_vec::<i64>();
    let (k, x) = (v[0], v[1]);
    for i in x - k + 1..x + k {
        print!("{} ", i);
    }
    println!("");
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
//  [rust]
use text_io::*;
use std::collections::*;
use std::process::exit;
use std::cmp::max;

fn main() {
    let mut a:isize = read!();
    let mut b:isize = read!();
    for i in b-a+1..a+b {
        println!("{}",i);
    }
}
//  [swift]
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

let k  = arr[0]
let x = arr[1]

var i : Int
for i in x-(k-1)...x+(k-1) {
  print( i )
}
//  [swift]
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

let k = arr[0]
let x = arr[1]

var i:Int
for i in x-(k-1)...x+(k-1) {
  print(i)
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let xk=readInts()
let k=xk[0]
let x=xk[1]
for i in (x-k+1)...(x+k-1){
  print(i,terminator:" ")
}
//  [swift]
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let reader=readInts()
let k=reader[0]
let x=reader[1]

var i=x-k+1
for _ in 1...2*k-1{
  print(i,terminator:"")
  print(" ",terminator:"")
  i+=1
}
//  [typescript]
'use strict'
function main(input: string) {
    const [a, b] = input.split(' ').map(Number);
    const start = b - (a-1);
    const end = b + (a-1);
    let r = [];
    for (let i = start; i <= end; i++) {
        r.push(i);
    }
    console.log(r.join(' '));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

function compareFunc(a, b){
    return a-b;
}

const [k, x]: number[] = input[0].split(' ').map((x: string): number => +x);

const li: number[] = [];

for(let i = x-k+1; i < x+k; i++){
    li.push(i);
}

console.log(li.join(' '));
//  [typescript]
const main = (lines: string) => {
  const data = lines.split(" ");
  const stoneLength = parseInt(data[0], 10);
  const stoneCoord = parseInt(data[1], 10);
  let stoneCoords = [stoneCoord];

  for (let i = 1; i < stoneLength; i++) {
    stoneCoords.push(stoneCoord - i);
    stoneCoords.push(stoneCoord + i);
  }

  let result = stoneCoords.sort(conmpareFunc).join(" ");

  console.log(result);
};

const conmpareFunc = (a: number, b: number) => {
  return a - b;
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
const t={input:require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/),n:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.n())}return a}else{const a=t.input[0];t.input.shift();return Number(a)}},s:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.s())}return a}else{const a=t.input[0];t.input.shift();return String(a)}},c:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.c())}return a}else{let a=t.input[0].split('');const b=a[0];a.shift();if(a.length>0){t.input[0]=a.join('')}else{t.input.shift()}return String(b)}},o:(...arg)=>{console.log(...arg)},abs:(a)=>{return Math.abs(a)},min:(...a)=>{return Math.min(...a)},max:(...a)=>{return Math.max(...a)},floor:(a)=>{return Math.floor(a)},asc:(ar:number[])=>{return ar.sort((a,b)=>{return a-b})},desc:(ar:number[])=>{return ar.sort((a,b)=>{return b-a})},sw:(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]}};
const main=()=>{
  let [a,b]=t.n(2)
  let ans =''
  for(let i=b-a+1;i<=b+a-1;i++){
    t.o(i)
  }
}
main()
//  [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(_: NormalInput) {
  const [K,X]=[_.int(),_.int()];
  for(let i=X-K+1;i<=X+K-1;i++)
  console.log(i);
}

//DO NOT EDIT
Main(new NormalInput(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
def main():
    import sys
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines
    sys.setrecursionlimit(10 ** 7)

    from collections import Counter

    n = int(readline())
    a = list(map(int, readline().split()))
    memo = [True] * (10 ** 6 + 1)
    ans = 0
    for k, v in sorted(Counter(a).items()):
        if v == 1 and memo[k]:
            ans += 1
        memo[k] = False
        for i in range(1, 10 ** 6 + 1):
            if 10 ** 6 + 1 <= i * k:
                break
            memo[i * k] = False
    print(ans)


if __name__ == '__main__':
    main()
//  [python]
from sys import stdin

n = [int(x) for x in stdin.readline().rstrip().split()]
a = [int(x) for x in stdin.readline().rstrip().split()]

# 使わなくて良い
# def get_sieve_of_eratosthenes_new(n):
#     import math
#     if not isinstance(n, int):
#         raise TypeError('n is int type.')
#     if n < 2:
#         raise ValueError('n is more than 2')
#     prime = []
#     limit = math.sqrt(n)
#     data = [i + 1 for i in range(1, n)]
#     while True:
#         p = data[0]
#         if limit <= p:
#             return prime + data
#         prime.append(p)
#         data = [e for e in data if e % p != 0]

# 倍数はOUTという判定を行ってく

# その前に複数あるものはのぞく

cnt = [0] * ((10**6)+1)
for elem in a:
    cnt[elem] += 1

filtered = []

for i in range((10**6)+1):
    if cnt[i] == 1:
        filtered.append(i)

# 倍数かどうかチェック用カウンタ
cnt = [0] * ((10**6)+1)

# 重複のない要素それぞれで倍数を見ていく（上限まで）
a = list(set(a))
for elem in a:
    # 自分自身はカウントしない
    # elemずつ増えるので、倍数という意味になる
    for i in range(elem*2, (10**6)+1, elem):
        cnt[i] += 1

ans = 0
# filteredのうち何らかの倍数になっていないものの数が答え
for i in filtered:
    if cnt[i] == 0:
        ans += 1

print(ans)
//  [python]
from numba import njit
import numpy as np

N = int(input())
A = list(map(int, input().split()))

@njit
def main(A):
  count = np.zeros(10**6 + 10, np.int32)
  
  for i in range(N):
    a = A[i]
    if count[a] > 1:
      continue
    count[::a] += 1
    
  ans = 0
  for i in range(N):
    ans += count[A[i]] == 1
    
  #print(count[:100])
  return ans
  
print(main(np.array(A, np.int32)))
//  [java]

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = Integer.parseInt(scan.next());
        Set<Integer> set = new HashSet<Integer>();
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();
        for (int i = 0; i < n; i++) {
            int a = Integer.parseInt(scan.next());
            map.put(a, 1);
            if (set.contains(a)) {
                map.put(a, 0);
            } else {
                set.add(a);
            }
        }
        scan.close();

        int ans = 0;
        for (int a : set) {
            if (map.get(a) == 0) {
                continue;
            }
            if (a == 1) {
                ans++;
                continue;
            }
            if (set.contains(1)) {
                continue;
            }

            boolean isOK = true;
            for (int j = 2; j <= Math.sqrt(a); j++) {
                if (a % j == 0) {
                    if (set.contains(j) || set.contains(a / j)) {
                        isOK = false;
                        break;
                    }
                }
            }
            if (isOK) {
                ans++;
            }
        }

        System.out.println(ans);
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.lang.Math;
import java.util.Map;
import java.util.ArrayList;
import java.util.Collections;

public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int n = fs.nextInt();
        int[] ar = fs.readArray(n);


        int count = 0;
        ArrayList<Integer> forbidden = new ArrayList<>();
        Arrays.sort(ar);
        boolean[] xr = f(ar,ar[n-1]+1);
        for (int i = 0; i<n-1; i++) {
            if (ar[i] == ar[i+1]) {
                forbidden.add(ar[i]);
            }
        }
        int av = 0;
        for (int i : ar) {
            if (xr[i] == true) {
                for (int q = 0; q<forbidden.size(); q++) {
                    if (i == forbidden.get(q)) {
                        av =1;
                        break;
                    }
                }
                if (av == 0) {
                    count++;
                } else {
                    av=0;
                }
            }
        }
        System.out.println(count);

    }
    public static boolean[] f(int[] ar, int n) {

        boolean[] x = new boolean[n];
        for (int i = 0; i < n; i++) {
            x[i] = true;
        }
        for (int a : ar) {
            for (int i = 2*a; i < n; i += a) {
                x[i] = false;
            }
        }
        return x;


    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

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

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    }

}
//  [cpp]
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <deque>
#include <numeric>
#include <sstream>
#include <iomanip>
#define ALL(X) X.begin(), X.end()
using lint = long long;
template <typename T>
void print_container(std::vector<T> vec)
{
    for (auto iter = vec.begin(); iter != vec.end(); ++iter)
    {
        std::cout << *iter << " ";
    }
    std::cout << std::endl;
}

int main()
{
    lint n;
    scanf("%lld", &n);

    std::vector<lint> a(n);
    for (int i = 0; i < n; ++i)
    {
        scanf("%lld", &a[i]);
    }

    std::unordered_map<lint, lint> ref;

    for (int i = 0; i < n; ++i)
    {
        if (ref.find(a[i]) == ref.end())
        {
            ref[a[i]] = 1;
        }
        else
        {
            ref[a[i]]++;
        }
    }

    lint ans = 0;

    if (ref[1] == 1)
    {
        std::cout << 1 << "\n";
    }
    else if (ref[1] > 1)
    {
        std::cout << 0 << "\n";
    }
    else
    {
        for (int i = 0; i < n; ++i)
        {
            lint cur = a[i];
            lint ok = 1;
            if (ref[cur] == 1)
            {
                for (int j = 2; j < sqrt(cur) + 0.005; ++j)
                {
                    if (cur % j == 0 && (ref.find(j) != ref.end() || ref.find(cur / j) != ref.end()))
                    {
                        ok = 0;
                        break;
                    }
                }
                if (ok == 1)
                {
                    ans++;
                }
            }
        }
        std::cout << ans << "\n";
    }

    return 0;
}
//  [cpp]
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
/*
// AUTHOR wiley_codechef
// TASK : Atcoder
//--------------------------------HEADERS-------------------------------------------------------------//
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <limits>
#include <string>
#include <cassert>
#include <cstring> 
#include <unordered_set>
#include <unordered_map>
using namespace std; 
*/
int n, ans;
vector<int> v(200010);
unordered_map<int, int> M;
int main(){
	cin >> n;
	for(int i=0;i<n;i++) {
		cin >> v[i + 1];
		M[v[i + 1]]++;
	}
	for (int i = 1; i <= n; i++) {
		int flag = 1;
		for (ll j = 1; j * j <= v[i]; j++) {
			if (v[i] % j == 0) {
				//v[i]/j, j
				if (j == v[i] && M[j] >= 2 || j != v[i] && M[j] >= 1 || v[i]/j == v[i] && M[v[i]/j] >= 2 || v[i]/j != v[i] && M[v[i]/j] >= 1) {
					flag = 0;
					break;
				}
			}
		}
		if (flag) ans++;
	}
	cout << ans;}
//  [c]
#include <stdio.h>
#define swap(type, x, y)  do{ type t = x; x = y; y = t; }while(0)

void quick(int array[], int left, int right){
  int pl = left, pr = right, x = array[(left+right)/2];
  do{
    while(array[pl] < x)  pl++;
    while(array[pr] > x)  pr--;
    if(pl <= pr){
      swap(int, array[pl], array[pr]);
      pl++, pr--;
    }
  }while(pl <= pr);
  if(pl < right)  quick(array, pl, right);
  if(pr > left)   quick(array, left, pr);
}

int main(){
  int n;  scanf("%d", &n);
  int a[200005] = {0};
  for(int i=1; i<=n; i++)  scanf("%d", a+i);
  quick(a, 1, n);
  if(a[1]==1){
    if(a[2]!=1){
      printf("1\n"); return 0;
    }else{
      printf("0\n"); return 0;
    }
  }
    
  int table[1000006] = {0};
  long ans = 0;
  for(int i=1; i<=n; i++){
    if(a[i-1]==a[i] || a[i]==a[i+1]){ table[a[i]] = 1;  continue; }
    int soin[1000] = {0};
    int ai = a[i];
    for(int j=2; j*j<=a[i]; j++){
      while(ai%j==0){
	soin[++soin[0]] = j;
	ai /= j;
      }
    }
    if(ai!=1) soin[++soin[0]] = ai;
    int thisans = 1;
    for(int bit=1; bit<(1<<soin[0]); bit++){
      int yaku = 1;
      for(int b=0; b<soin[0]; b++){
	if(bit & (1<<b))
	  yaku *= soin[b+1];
      }
      if(table[yaku]){ thisans = 0; break; }
    }
    if(thisans){ ans++; }// printf("ok : %d\n", a[i]); }
    table[a[i]] = 1;
  }
  printf("%ld\n", ans);
  return 0;
}
//  [c]
#include <stdio.h>
#include <math.h>

int a[1000001];

int calc_divisor(int aa)
{
    if (aa != 1 && a[1] > 0)
    {
        return 0;
    }

    // printf("%d ---\n", aa);
    int n = (int)sqrt((double)aa);
    for (int i = 2; i <= n; i++)
    {
        if (aa % i != 0)
        {
            continue;
        }
        // printf("%d, %d\n", i, aa / i);
        if (a[i] > 0 || a[aa / i] > 0)
        {
            return 0;
        }
    }
    return 1;
}

int main()
{
    int n;
    scanf("%d", &n);

    for (int i = 0; i < n; i++)
    {
        int aa;
        scanf("%d", &aa);
        a[aa]++;
    }

    int ans = 0;
    for (int i = 1; i < 1000001; i++)
    {
        if (a[i] == 0 || a[i] > 1)
        {
            continue;
        }
        // printf("%d: %d\n", i, a[i], calc_divisor(a[i]));
        if (calc_divisor(i) == 1)
        {
            ans++;
        }
    }
    printf("%d\n", ans);

    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

int n;
int a[200010];
int aa[1000010];
int main(){
	scanf("%d",&n);
	rep(i,0,n)scanf("%d",a+i);
	rep(i,0,n)aa[a[i]]++;

	int ans=0;
	rep(i,0,n){
		int flag=aa[a[i]]==1;
		if(a[i]!=1)flag&=aa[1]==0;
		for(int d=2;d*d<=a[i];d++)if(a[i]%d==0)flag&=aa[d]==0&&aa[a[i]/d]==0;
		if(flag)ans++;
	}
	
	printf("%d",ans);
}
//  [javascript]
//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  myerr("-----start-----");
  var start = new Date();
  Main();
  var end = new Date() - start;
  myerr("----- end -----");
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var N = nextInt();
	var list = nextIntArray();
	var map = {};
	var submap = new Set();
	var sameSet = new Set();
	for(var i = 0; i < N; i++){
		if(submap.has(list[i])){
			sameSet.add(list[i]);
		}
		submap.add(list[i]);
		if(map[list[i]] == null){
			map[list[i]] = getDivisorList(list[i]);
		}
	}
	var output = 0;
	for(var i = 0; i < N; i++){
		if(sameSet.has(list[i])){
			continue;
		}
		var getDiv = map[list[i]];
		var isOK = true;
		for(var j = 0; j < getDiv.length; j++){
			if(getDiv[j] != list[i] && submap.has(getDiv[j])){
				isOK = false;
				break;
			}
		}
		if(isOK){
			output++;
		}
	}
	myout(output);
}
function getDivisorList(val){
  var list = [];
  for(var i = 1; i * i <= val; i++){
    if(val % i == 0){
      list.push(i);
      if(i * i != val){
        list.push(val / i);
      }
    }
  }
  list.sort(function(a,b){ return a - b; });
  return list;
}
//  [javascript]
//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  myerr("-----start-----");
  var start = new Date();
  Main();
  var end = new Date() - start;
  myerr("----- end -----");
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var N = nextInt();
	var list = nextIntArray();
	var map = {};
	var submap = new Set();
	var sameSet = new Set();
	for(var i = 0; i < N; i++){
		if(submap.has(list[i])){
			sameSet.add(list[i]);
			continue;
		}
		submap.add(list[i]);
		if(map[list[i]] == null){
			map[list[i]] = getDivisorList(list[i]);
		}
	}
	var output = 0;
	for(var i = 0; i < N; i++){
		if(sameSet.has(list[i])){
			continue;
		}
		var getDiv = map[list[i]];
		var isOK = true;
		for(var j = 0; j < getDiv.length; j++){
			if(getDiv[j] != list[i] && submap.has(getDiv[j])){
				isOK = false;
				break;
			}
		}
		if(isOK){
			output++;
		}
	}
	myout(output);
}
function getDivisorList(val){
  var list = [];
  for(var i = 1; i * i <= val; i++){
    if(val % i == 0){
      list.push(i);
      if(i * i != val){
        list.push(val / i);
      }
    }
  }
  list.sort(function(a,b){ return a - b; });
  return list;
}
//  [javascript]
//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  myerr("-----start-----");
  var start = new Date();
  Main();
  var end = new Date() - start;
  myerr("----- end -----");
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var N = nextInt();
	var list = nextIntArray();
	var map = {};
	var submap = new Set();
	var sameSet = new Set();
	for(var i = 0; i < N; i++){
		if(submap.has(list[i])){
			sameSet.add(list[i]);
			continue;
		}
		submap.add(list[i]);
		if(map[list[i]] == null){
			map[list[i]] = getDivisorList(list[i]);
		}
	}
	var output = 0;
	for(var i = 0; i < N; i++){
		if(sameSet.has(list[i])){
			continue;
		}
		var getDiv = map[list[i]];
		var isOK = true;
		for(var j = 0; j < getDiv.length; j++){
			if(getDiv[j] != list[i] && submap.has(getDiv[j])){
				isOK = false;
				break;
			}
		}
		if(isOK){
			output++;
		}
	}
	myout(output);
}
function getDivisorList(val){
  var list = [];
  for(var i = 1; i * i <= val; i++){
    if(val % i == 0){
      list.push(i);
      if(i * i != val){
        list.push(val / i);
      }
    }
  }
  //list.sort(function(a,b){ return a - b; });
  return list;
}
//  [go]
package main

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

const (
	initialBufSize = 10000
	maxBufSize     = 10000000
)

var (
	sc = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
)

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

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

func nextFloat() float64 {
	sc.Scan()
	f, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func main() {
	n := nextInt()
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}

	sort.Ints(a)
	flags := make(map[int]bool)
	dup := make(map[int]bool)
	ok := make(map[int]bool)
	for _, v := range a {
		flag := true
		for i := 1; i*i <= v; i++ {
			if v%i == 0 {
				if flags[i] {
					flag = false
				}
				if i*i != v {
					if flags[v/i] {
						flag = false
					}
				}
			}
		}
		if ok[v] {
			dup[v] = true
		}
		if flag && !flags[v] {
			ok[v] = true
		}
		flags[v] = true
	}
	fmt.Println(len(ok) - len(dup))
}
//  [go]
package main

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

const (
	initialBufSize = 1e4
	maxBufSize     = 1e10
)

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

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

func nextFloat() float64 {
	sc.Scan()
	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	buf := make([]byte, initialBufSize)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords)

	one := 0
	n := nextInt()
	m := make(map[int]int)
	sl := make([]int, n)
	for i := 0; i < n; i++ {
		a := nextInt()
		if a == 1 { one++ }
		m[a] += 1
		sl[i] = a
	}
	if one > 1 {
		fmt.Println(0)
		return
	}
	if one == 1 {
		fmt.Println(1)
		return
	}

	count := 0
	for _, v := range sl {
		if m[v] > 1 { continue }
		i := 2
		flag := true
		for i*i <= v {
			if v%i == 0 {
				if _, ok := m[i]; ok {
					flag = false
					break
				}
				if _, ok := m[v/i]; ok {
					flag = false
					break
				}
			}
			i++
		}
		if flag { count++ }
	}
	fmt.Println(count)
}

func intSlicePrint(el ...int) {
	first := true
	for _, v := range el {
		if v < 0 {
			continue
		}
		if !first {
			fmt.Printf(" ")
		}
		fmt.Printf("%v", v)
		first = false
	}
	fmt.Println("")
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
//  [go]
package main

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

func main() {
	N := nextInt()
	A := make([]int, N)
	numbers := map[int][]int{}
	M := 1

	for i := 0; i < N; i++ {
		a := nextInt()
		A[i] = a
		numbers[a] = append(numbers[a], i)
		M = max(a, M)
	}

	c := 0

	for i, l := range numbers {
		if len(l) > 1 {
			continue
		}
		divs := divisors(i)
		// debug(i, divs)
		exists := false
		for j := 0; j < len(divs); j++ {
			_, ok := numbers[divs[j]]
			if ok && divs[j] != i {
				exists = true
				break
			}
		}
		if !exists {
			c++
		}
	}

	fmt.Println(c)
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func divisors(n int) []int {
	divs := make([]int, 0)

	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			divs = append(divs, i)

			if i != n/i {
				divs = append(divs, n/i)
			}
		}
	}

	return divs
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextBytes() []byte {
	stdin.Scan()
	return stdin.Bytes()
}

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

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}

func debug(args ...interface{}) {
	fmt.Fprintln(os.Stderr, args)
}
//  [ruby]
n = gets.chomp.to_i
as = []
aset = {}
gets.chomp.split(' ').each{|i|
  ii = i.to_i
  if aset[ii].nil?
    aset[ii] = 0
    index = as.bsearch_index{|v| v > ii }
    if index.nil?
      as.push(ii)
    else
      as.insert(index, ii)
    end
  end
  aset[ii] += 1
}

# p aset
# p as

last = as.last

j = 0
as.each{|aj|
  if aset[aj] === -1
    j += 1
    next
  end

  mul = 2
  ai = aj * mul
  while ai <= last
    if aset[ai] != -1
      aset[ai] = -1
    end
    mul += 1
    ai = aj * mul
  end
  j += 1
}

# p aset

puts as.filter{|ai| aset[ai] === 1 }.length
//  [ruby]
require "set"
n = gets.chomp.to_i
a_arr = gets.chomp.split(" ").map(&:to_i)

hash = {}
set = Set.new
a_arr.each do |a|
  hash[a] ||= 0
  hash[a] += 1
  set << a
end

max = 10 ** 6 
hash.each do |k, v|
  i = v > 1 ? 1 : 2
  tmp = k * i
  while tmp <= max do
    set.delete(tmp)
    i += 1
    tmp = k * i
  end
end

puts set.size
//  [ruby]
#!/usr/bin/env ruby

require 'prime'
require 'prime'

N = gets.chomp.to_i
A = gets.chomp.split.map(&:to_i).sort

dp = Hash.new(true)

A.each do |a|
  m = 2
  next unless dp[a]

  loop do
    b = a * m
    break if b > A[-1]
    dp[b] = false
    m += 1
  end
end

hash = A.tally.reject {|_, c| c > 1 }

puts hash.count { |a, _| dp[a] }
//  [rust]
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use num::Integer;
#[allow(unused_imports)]
use proconio::derive_readable;
use proconio::fastout;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::cmp;

use std::collections::{BTreeMap, BTreeSet};
fn divisor(n: i64) -> BTreeSet<i64> {
    let mut i = 1;
    let mut div = BTreeSet::new();
    while i * i <= n {
        if n % i == 0 {
            div.insert(i);
            if n / i != i {
                div.insert(n / i);
            }
        }
        i += 1;
    }
    div
}

#[fastout]
fn main() {
    input! {
        n: usize,
        mut a: [i64; n],
    }
    a.sort();
    let mut popl = BTreeMap::new();
    for &x in &a {
        *popl.entry(x).or_insert(0) += 1;
    }
    let mut set = BTreeSet::new();
    let mut ans = 0;
    for &x in &a {
        if popl[&x] > 1 {
            set.insert(x);
            continue;
        }
        let mut ok = true;
        for &d in &divisor(x) {
            if set.contains(&d) {
                ok = false;
                break;
            }
        }
        if ok {
            ans += 1;
        }
        set.insert(x);
    }

    println!("{}", ans);
}
//  [rust]
#[allow(unused_imports)]
use proconio::{input, marker::*};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

fn fact(n: usize) -> Vec<usize> {
    let mut res = Vec::new();
    for i in 1.. {
        if i * i > n {
            break;
        }
        if i * i == n {
            res.push(i);
        } else if n % i == 0 {
            res.push(i);
            res.push(n / i);
        }
    }
    res
}

fn main() {
    input! {
        n: usize,
        mut a: [usize; n],
    }

    let mut map = BTreeMap::new();
    for &e in &a {
        *map.entry(e).or_insert(0) += 1;
    }
    let mut sum = 0usize;
    for &e in &a {
        let val = map.get(&e).cloned().unwrap();
        if val > 1 {
            continue;
        }

        let mut flag = false;
        for b in fact(e) {
            if e == b {
                continue;
            }
            if map.contains_key(&b) {
                flag = true;
            }
        }
        if !flag {
            sum += 1;
        }
    }
    println!("{}", sum);
}
//  [swift]
import Foundation

func readInt() -> Int {
    return Int(readLine()!)!
}

func readInts(separator: String.Element = " ") -> [Int] {
    return readLine()!.split(separator: separator).map { Int($0)! }
}

func readTwoInts(separator: String.Element = " ") -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

extension Int {

    // 約数
    var divisors: [Int] {
        var divisors: [Int] = []

        // √Nまで
        for number in 1...Int(sqrt(Double(self))) {
            if self % number == 0 {
                divisors.append(number)

                // N / aが割り切れる場合、N / aも約数
                if self.isMultiple(of: number), self / number != number {
                    divisors.append(self / number)
                }
            }
        }

        divisors.sort(by: <)

        return divisors
    }
}

func mainD() {
    let N = readInt()
    let numbers = readInts()

    // 各数字があるかないかを表す配列
    var exists: [Bool] = .init(repeating: false, count: 1_000_000 + 1)
    // 重複
    var doubleExists: [Bool] = .init(repeating: false, count: 1_000_000 + 1)

    for number in numbers {
        if exists[number] {
            doubleExists[number] = true
            continue
        }

        exists[number] = true
    }

    var count = 0
    for number in numbers {
        if doubleExists[number] {
            continue
        }

        var answer = true

        // 約数で自分以外
        var divisors = number.divisors
        divisors.removeLast()
//        if divisors.count > 1 {
//            divisors.remove(at: 1)
//        }

        for divisor in divisors {
            if exists[divisor] {
                answer = false
                break
            }
        }

        if answer {
            count += 1
        }
    }

    print(count)
}
mainD()
//  [swift]
import Foundation

let N = Int(readLine()!)!
let values = readLine()!.components(separatedBy: " ").map({Int($0)!})

func later_pattern() {
    var count = 0
    for i in 0 ..< N {
        var ok = true
        for j in 0 ..< N {
            if i == j { continue }
            if values[i] % values[j] == 0 {
                ok = false
                continue
            }
        }
        if ok {
            count += 1
        }
    }

    print(count)
}

func fast_pattern() {
    let sorted = values.sorted()
    var dp = [Bool](repeating: true, count: sorted.last! + 1)
    for i in 0 ..< N {
        if dp[sorted[i]] == false {continue}
        // 同じ数があるかチェック
        if 0 < i, sorted[i] == sorted[i - 1] {
            dp[sorted[i]] = false
        }
        // 倍数をマークする
        var a = sorted[i] * 2
        while a <= sorted.last! {
            dp[a] = false
            a += sorted[i]
        }
    }

    var count = 0
    for i in 0..<N {
        if dp[values[i]] {
            count += 1
        }
    }
    print(count)
}

fast_pattern()
//  [swift]
import Foundation
// Decimal型の有効桁数は38桁
let N = readLine()!.components(separatedBy: " ").map { Int($0)! }.first!
let A = readLine()!.components(separatedBy: " ").map { Int($0)! }
let sortedA = A.sorted()

var dp = Array(repeating: true, count: sortedA.last! + 1)
var count = 0

for i in 0..<N {
    guard dp[sortedA[i]] else { continue }
    if 0 < i, sortedA[i] == sortedA[i - 1] {
        dp[sortedA[i]] = false
    }
    
    var a = sortedA[i] * 2
    while a <= sortedA.last! {
        dp[a] = false
        a += sortedA[i]
    }
}

for i in 0..<N {
    if dp[A[i]] {
        count += 1
    }
}

print(count)
//  [python]
import numpy as np

N = int(input())
if N%2==0:
  a = int(N / 2)
else:
  a = int(np.floor(N / 2) + 1)

print(a)
//  [python]

#####

import numpy as np
from numpy import newaxis, float32, float64, int32, int64, int16, int8, uint8, uint32, complex64, complex128

#####

def getIntList(inp):
	return [int(_) for _ in inp]
	

from sys import stdin

def getInputs():
	inputs=[]
	for line in stdin:
		line=line.split()
		inputs.append(line)
	return inputs


def m(t0,x0,y0,t1,x1,y1):
	d=abs(x1-x0)+abs(y1-y0)
	dt=t1-t0
	if d>dt: return False
	dd=d-dt
	return dd%2==0


def main(inputs):
	n=int(inputs[0][0])
	print(int(np.ceil(n/2)))
	

if __name__=="__main__":
	inputs=getInputs()
# 	inputs=simInputs()
	main(inputs)
//  [python]
import numpy as np
n = int(input())
if n%2 == 0:
    print(n//2)
else:
    print(n//2+1)
//  [java]
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();

        System.out.println((N+1)/2);

    }

}
//  [java]
import java.util.*;
import java.io.*;

public class Main implements Runnable{
    static Scanner sc = new Scanner(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException{
        new Thread(null, new Main(), "", 32 * 1024 * 1024).start();
        Thread.setDefaultUncaughtExceptionHandler((t,e)->System.exit(1));
        out.flush();
    }

    public void run(){
        int N = Integer.parseInt(sc.next());
        if(N%2 != 0){
            N = N+1;
        }
        out.println(N/2);
        out.flush();
    }

}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

//System.out.println();
public class Main implements Runnable { //クラス名はMain1

	public static void main(String[] args) {
		Thread.setDefaultUncaughtExceptionHandler((t, e) -> System.exit(1));
		new Thread(null, new Main(), "", 16 * 1024 * 1024).start(); //16MBスタックを確保して実行
	}

	public void run() {
		FastScannerMain1 sc = new FastScannerMain1(System.in);

		try {
			int N = sc.nextInt();

			int ans = 0;
			if (N % 2 == 1) {
				ans = N / 2 + 1;
			} else {
				ans = N / 2;
			}

			System.out.println(ans);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}

//高速なScanner
class FastScannerMain1 {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScannerMain1(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

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

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

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

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}
//  [c]
#include<stdio.h>

int main() {
   int N;

   scanf("%d", &N);

   if(N % 2 == 0) {
      printf("%d\n", N/2);
   }else {
      printf("%d\n", (N/2)+1);
   }
   return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main () 
{

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

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

    }
    return 0;
}
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
    var a = input[0]-0;
    console.log(Math.ceil(a/2));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n"));
//  [javascript]
'use strict'
const Main=input=>{
    input/=2;
    input=Math.round(input);
    
    console.log(`${input}`);
}

Main(require("fs").readFileSync("/dev/stdin","utf8"));
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
  input = input.split("\n")[0];

  
  console.log(Math.round(input / 2))
}

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

import "fmt"

func main() {
  var n int
  fmt.Scan(&n)
  fmt.Println((n + 1) / 2)
}
//  [go]
package main

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

func main() {
	n := readI()
	fmt.Println((n + 1) / 2)
}

/*-----------Input utils-----------*/

var sc = bufio.NewScanner(os.Stdin)

func init() {
	if len(os.Args) >= 2 {
		if os.Args[1] == "debug" {
			debug()
		}
	}
	const buf = 200100
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, buf), buf)
}

func debug() {
	testFile, err := os.Open("./test/sample-1.in")
	if err != nil {
		fmt.Fprintln(os.Stderr, "There is no testfile.")
		os.Exit(1)
	}
	sc = bufio.NewScanner(testFile)
}

func readS() string {
	sc.Scan()
	return sc.Text()
}

func readR() []rune {
	return []rune(readS())
}

func readI() int {
	i, _ := strconv.Atoi(readS())
	return i
}

func readF() float64 {
	f, _ := strconv.ParseFloat(readS(), 64)
	return f
}
//  [ruby]
def get_int
  gets.chomp.to_i
end

N = get_int

puts N / 2 + N % 2
//  [ruby]
n = gets.to_i
puts (n + 1) / 2
//  [ruby]
n = gets.chomp.to_i

print (n/2+n%2)
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {n: u16};

    println!("{}", n / 2 + n % 2);
}
//  [swift]
let input = Int(readLine()!)!

if (input % 2 == 0) {
    print(input/2)
  } else {
    print((input/2)+1)
  }
//  [swift]
let input_line = Int(readLine()!)
let result = Int(input_line! / 2) + (input_line! % 2)

print(result)
//  [swift]
var n: Int = Int(readLine()!)!
print((n+1)/2)