jiahuimbzuai/CoQuIR huggingface dataset:
//  [rust]
use std::io::stdin;
use std::str::FromStr;

fn read_line<T>() -> Vec<T>
where
    T: FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect()
}

fn read_str_as_char_vec() -> Vec<char> {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    s.trim().chars().collect()
}

fn read_str_as_T<T>() -> T 
where
    T: FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    s.trim().parse().unwrap()
}

fn main() {
    let x: usize = read_line()[0];

    let mut res = 0;
    let mut base: usize = 100;
    while (base as usize) < x {
        base = ((base as f64) * 1.01) as usize;
        res += 1;
    }

    println!("{}", res);
    // let a_base = (x/100.).log(1.01);
    // if a_base.fract() == 0. {
    //     println!("{}", a_base as usize);
    // } else {
    //     println!("{}", a_base as usize + 1);
    // }
}
//  [rust]
#![allow(unused_imports)]
use std::cmp::*;
use std::collections::*;
use itertools::Itertools;
use proconio::{input, marker::*};
use superslice::*;
use whiteread::parse_line;

fn main() {
    let x: i64 = parse_line().unwrap();
    let mut num: i64 = 100;
    let mut count: usize = 1;
    loop {
        num = (num / 100) + num;
        if num >= x {
            break;
        }
        count = count + 1;
    }
    println!("{}", count);
}
//  [rust]
#[allow(unused_imports)]
use proconio::{
    fastout, input,
    marker::{Bytes, Chars, Isize1, Usize1},
};
#[fastout]
fn main() {
    input!(x: usize);
    let mut n = 100;
    let mut count = 0;
    while n < x {
        n = (n as f64 * 1.01) as usize;
        count += 1;
    }

    println!("{}", count);
}
//  [rust]
#![allow(unused_imports)]
#![allow(unused_variables)]

use itertools::Itertools;
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        x: f64,
    }
    // annotate for rust-analyzer
    let x: f64 = x;

    let mut ans = 0;
    let mut yen = 100f64;
    while yen < x {
        yen = (yen * 1.01f64).floor();
        ans += 1;
    }

    println!("{}", ans);
}
//  [rust]
#![allow(non_snake_case)]
use proconio::input;
// use std::collections::HashMap;

fn main() {
    input! {
        X: i64,
    }

    let mut money: i64 = 100;
    let mut year = 0;
    while money < X {
        money = (money as f64 * 1.01) as i64;
        year += 1;
    }

    println!("{}", year);
}
//  [swift]
let x = Int(readLine()!)!
var yen = 100
var year = 0
while x > yen {
  year += 1
  let tmp = yen
  yen += Int(Double(tmp) * 0.01)
}
print(year)
//  [swift]
let X = Int(readLine()!)!
var deposit = 100
var year = 0
while deposit < X {
    year += 1
    deposit += deposit / 100
}
print(year)
//  [swift]
let x = Int(readLine()!)!

var deposit = 100
var c = 0
while deposit < x {
  c += 1
  deposit = Int(Double(deposit) * 1.01)
}

print(c)
//  [swift]
import Foundation

let input_line: String = readLine()!
//let split: [String] = input_line.components(separatedBy: " ")
//let a = Int(split[0])!
//let b = Int(split[1])!
let x = Int(input_line)!
var money : Int64 = 100
var i : Int64 = 0
while(true) {
    if money >= x {
        print(i)
        break
    }
    money *= (money / 100)
    i += 1
}
//  [swift]
import Foundation

let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ") //ブランクで区切られている場合

var x = Int64(split[0])!

var money: Int64 = 100

var ans = 0
while (money < x) {
    money = Int64(Double(money) * 1.01)
    ans += 1
}

print(ans)
//  [swift]
import Foundation

let input_line: String = readLine()!
let x = Int(input_line)!
var y = Int(100)
var i: Int = 0

while y < x{
  y = Int(Double(y) * 1.01)
  i += 1
}

print("\(i)")
//  [typescript]
import * as fs from 'fs'

const input = (fs.readFileSync('/dev/stdin', 'utf8') as string).split('\n')
const x = +input[0]

let i = 1
let sum = 100

while (true) {
  sum += Math.floor(sum * 0.01)
  if (x <= sum) {
    break
  }
  i++
}

console.log(i)
//  [typescript]
import * as fs from 'fs'
import {debug} from '../../../util'

const input = fs.readFileSync('/dev/stdin', 'utf8')
const output = (x: any) => console.log(x)
// debug(input)
const X = +input
let year = 0
let money = 100
while (money < X) {
    money += Math.floor(money * 0.01)
    year++
}
output(year)
//  [typescript]
import * as fs from 'fs';

namespace AtCoder {
    export interface Paramable {
        readonly args: string[][];
    }

    export interface Task {
        main(this: Task): void;
    }
}

namespace AtCoder.abc001 {
    export class TaskA implements AtCoder.Task, AtCoder.Paramable {
        public constructor(public readonly args: string[][]) {
        }

        public main(this: TaskA): void {
            const x: number = +this.args[0][0];


            let xx = 100;
            let ans = 0;

            while (x > xx) {
                xx += Math.floor((xx*0.01));
                ans++;
            }
            console.log(ans);
        }
    }

    const args: string[][] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n').map(r => r.split(' '));
    const task: AtCoder.Task = new TaskA(args);
    task.main();
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const X = BigInt(input[0][0]);

  let deposit = 100n;
  let years = 0;

  while (deposit >= X) {
    deposit += deposit / 100n;
    years += 1;
  }

  return years;
};

console.log(main(read()));
//  [typescript]
import * as fs from 'fs';
import { multiplies } from 'tstl';

export function Main(input: string) {
    const x = parseInt(input);   // ?

    let year = 0;
    let deposit = 100 * 100;

    while (deposit < x * 100) {
        deposit = multiplies(deposit, 1.01); // ?
        deposit = ~~deposit;    // ?
        year++;
    }

    //output

    console.log(year);
}

// Don't edit this line!
Main(fs.readFileSync("/dev/stdin", "utf8"));
//  [typescript]
import * as fs from 'fs';
import { divides, modules, multiplies } from 'tstl';

export function Main(input: string) {
    const x = parseInt(input) * 100;   // ?

    let year = 0;
    let deposit = 100 * 100;

    while (deposit < x) {
        let deposit1 = multiplies(deposit, 1.01);
        deposit = Math.floor(deposit1);
        year++;
    }

    //output
    console.log(year);
}

// Don't edit this line!
Main(fs.readFileSync("/dev/stdin", "utf8"));
//  [python]
import math
N,X,T=map(int,input().split())
ans=math.ceil(N/X)*T
print(ans)
//  [python]
import math
N, X, T = map(int,input().split())
if N%X == 0:
    print(int(N/X*T))
else:
    print((math.floor(N/X)+1)*T)
//  [python]
n,x,t=list(map(int,input().split()))
import math
print(math.ceil(n/x)*t)
//  [python]
N, X, T = (int(d) for d in input().split())

print((N // X) * T)
//  [python]
#abc176b
N=input()
s=0
for i in range(len(N)):
 s+=int(N[i])
if s%9==0:
 print('Yes')
else:
 print('No')
//  [python]
n,x,t=map(int, input().split())
print(n//x*t+t)
//  [java]
import java.io.*;
import java.util.*;

class Main {
	
	public static void main(String[] args) {
        FastScanner in = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt(), x = in.nextInt(), t = in.nextInt();
        long ans = 0;
        int y = n/x;
        if(n%x!=0) y++;
        ans = y*t;
        out.println(ans);
        
        out.flush();
	}
	
	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		
		String next() {
			while(!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				}catch(IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		
		long nextLong() {
			return Long.parseLong(next());
		}
		
		int[] readArray(int n) {
			int a[] = new int[n];
			for(int i=0;i<n;i++) a[i] = nextInt();
			return a;
		}
		
		long[] readArray(int n,long x) {
			long a[] = new long[n];
			for(int i=0;i<n;i++) a[i] = nextLong();
			return a;
		}
		
	}
}
//  [java]
import java.io.*;
import java.math.*;
import java.util.*;
import java.util.regex.*;


public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static long cnt=0;
	public static PrintWriter pw = new PrintWriter(System.out);
	public static void main(String[] args) throws Exception {
		solveA(args);
//		solveB(args);
//		solveC(args);
//		solveD(args);
//		solveE(args);
//		solveF(args);
		if(in!=null){
			in.close();
		}
		pw.flush();
		pw.close();
	}

	public static void solveA(String[] args) throws Exception{
		int N= nextInt();
		int X= nextInt();
		int T= nextInt();
		pw.println(((N+X-1)/X)*T);
	}
	public static void solveB(String[] args) throws Exception{

	}
	public static void solveC(String[] args) throws Exception{

	}

	public static void solveD(String[] args) throws Exception{

	}


	public static void solveE(String[] args) throws Exception{

	}

	public static void solveF(String[] args) throws Exception{

	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}

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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ATakoyaki solver = new ATakoyaki();
        solver.solve(1, in, out);
        out.close();
    }

    static class ATakoyaki {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt(), x = in.nextInt(), t = in.nextInt();

            out.println((((n + x) - 1) / x) * t);
        }

    }

    static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

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

    }
}
//  [java]

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.PriorityQueue;
import java.util.StringTokenizer;



 class A{
	




	public static void main(String[] args) throws IOException {
		
		
		FastScanner sc=new FastScanner();
		
		int n = sc.nextInt();
		int x = sc.nextInt(),t = sc.nextInt();
		int val = n/x * t;
		if(n%x != 0)
			val+=t;
		System.out.println(val);
		
		
	}
	
	
	
	
 
	static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				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;
		}
		long[] readArrayLong(int n) {
        	long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
        }
		long nextLong() {
			return Long.parseLong(next());
		}
		String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
	}
}
//  [java]

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.PriorityQueue;
import java.util.StringTokenizer;



public class A{
	




	public static void main(String[] args) throws IOException {
		
		
		FastScanner sc=new FastScanner();
		
		int n = sc.nextInt();
		int x = sc.nextInt(),t = sc.nextInt();
		int val = n/x * t;
		if(n%x != 0)
			val+=t;
		System.out.println(val);
		
		
	}
	
	
	
	
 
	static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				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;
		}
		long[] readArrayLong(int n) {
        	long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
        }
		long nextLong() {
			return Long.parseLong(next());
		}
		String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
	}
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int x = in.nextInt();
		int t = in.nextInt();
		int ans = n / x;
		if (n % x != 0)
			ans++;
		System.out.println(ans);
	}
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
ll powmod(ll n, ll k, ll m) {
ll r=1;
 for(; k>0; k >>=1) {
   if(k&1) r=(r*n)%m;
   n=(n*n)%m;
 }
  return r;
}

ll fact(ll n) {
ll a=1;
rep(i,n) {
a=a*(n-i);
}
return a;
}

ll pow(ll a, ll b) {
ll x=1;
rep(i,b) {
x=x*a;
}
return x;
}

int main() {
  ll N;
  ll X;
  ll T;
  cin >>N>>X>>T;
  cout<<((N+X-1)/X)*T<<endl;
}
//  [cpp]
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <climits>
#include <assert.h>
#include <cstring>
#include <set>

using namespace std;

typedef long long ll;

int main()
{
    int N, X, T;
    cin >> N >> X >> T;
    cout << (N+X-1)/X*T;
    
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    ll n, x, t;
    cin >> n >> x >> t;
    if (n<x) {
        cout << t;
        return 0;
    }
    if (n%x!=0) cout << (n/x+1)*t;
    else cout << n/x*t;
    return 0;
}
//  [cpp]
#include <iostream>

using namespace std;

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

int main(){
  int n,x,t;
  int ans;
  ans = (n/x)*t;
  if(n%x) ans += t;
  cout<<ans<<endl;
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main() {
  
  int N,X,T;
  cin >> N >> X >> T;
  int jikan = 0;
  while(jikan*T*X <= N){
    jikan++; }
  
  cout << jikan*T << endl;
  
  
}
//  [c]
#include <stdio.h>

int main(void) {
	int n,x,t;
	int count;
	int ans;
	
	scanf("%d%d%d",&n,&x,&t);
	count = (n/x);
	if(n%x == 0){
		ans = (count)*t;
	}
	else{
		ans = (count+1)*t;
	}
	printf("%d",ans);
	
	
}
//  [c]
#include <stdio.h>
int main(void){
	int n, x, t;
	int kai;
	scanf("%d", &n);
	scanf("%d", &x);
	scanf("%d", &t);
	kai = n%x == 0 ? n/x : n/x+1;
	printf("%d\n", kai*t);
	return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
int main(int argc, char const *argv[])
{
    int N, X, T;
    scanf("%i", &N);
    scanf("%i", &X);
    scanf("%i", &T);
    printf("%i\n", (N + X - 1) / X * T);
    return 0;
}
//  [c]
#include<stdio.h>

#include<conio.h>
 
char s[200010];
int main(){
    scanf("%s",s);
    int len=strlen(s);
    int sum=0;
    for(int i=0;i<len;i++)sum+=s[i]-'0';
    if(sum%9==0){
        puts("Yes");
    }else{
        puts("No");
    }
}
 
char s[200010];
int main(){
    scanf("%s",s);
    int len=strlen(s);
    int sum=0;
    for(int i=0;i<len;i++)sum+=s[i]-'0';
    if(sum%9==0){
        puts("Yes");
    }else{
        puts("No");
    }
}
//  [c]
#include<stdio.h>
int main(void){
  int n,x,t,cnt=0;
  scanf("%d %d %d",&n,&x,&t);
  for(;n>x;n -= x) cnt += t;
  printf("%d",cnt);
 return 0;
}
//  [c]
#include<stdio.h>
int main(void){
  int n,x,t,cnt=0;
  scanf("%d %d %d",&n,&x,&t);
  while(n>x){
    cnt += t;
    n -= x;
  }
  printf("%d",cnt);
 return 0;
}
//  [javascript]
function main(input){
  let list = input.split(" ");
  let n = parseInt(list[0]);//作る数
  let x = parseInt(list[1]);//一度に作れる数
  let t = parseInt(list[2]);//time
  let answer = Math.ceil(n/x)*t;
  console.log(answer);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));

function main(){
  var [n,x,t] = nexts(3);
  return Math.ceil(n/x)*t;
}
//  [javascript]
function Main(input) {
    input = input.trim().split("\n").map(function(x) { return x.split(" ")});
    let N = parseInt(input[0][0], 10);
    let X = parseInt(input[0][1], 10);
    let T = parseInt(input[0][2], 10);
    if (N % X === 0) console.log(T * N / X );
    else console.log(Math.ceil(N / X) * T);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input){
    const args=input.split(' ');
    const n=args[0];
    const x=args[1];
    const t=args[2];
    const a=int(n/x);
    if(n%x!=0){
        a++;
    }
    console.log(a*t);
}

main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
function main(input){
    const args=input.split(' ');
    const n=args[0];
    const x=args[1];
    const t=args[2];
    let a=n/x;
    if(n%x!=0){
        a++;
    }
    console.log(a*t);
}

main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
function Main(input) {
  const LINES = input.split("\n");
  const N = parseInt(LINES[0]);
  const X = parseInt(LINES[1]);
  const T = parseInt(LINES[2]);

  let answer = 0;
  answer = Math.floor(N / X) * T;
  if N % X != 0{
    answer += T;
  }

  console.log(answer);

}
// デバッグ用
function debug(){
var input = document.getElementById("input").value;
Main(input);
}

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

import (
	"fmt"
)

func main() {
	var n, x, t int64
	fmt.Scan(&n, &x, &t)

	if n % x == 0 {
		fmt.Println(n/x * t)
	} else {
		fmt.Println((n/x + 1) * t)
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n int
	var x int
	var t int

	fmt.Scan(&n)
	fmt.Scan(&x)
	fmt.Scan(&t)

	var ans int

	if n % x == 0 {
		ans = n / x * t
	} else {
		ans = (n / x + 1) * t
	}

	fmt.Println(ans)
}
//  [go]
package main

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

func main() {
	scanInit()

	n := nextInt()
	x := nextInt()
	t := nextInt()

	if n%x == 0 {
		fmt.Println(t * (n / x))
		return
	}
	fmt.Println(t + t*(n/x))

}

// ---- readfunc
var sc = bufio.NewScanner(os.Stdin)

func scanInit() {
	const cap = 200 * 1024 // default=64*1024
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [go]
package main

import (
	"fmt"
	_ "net/http/pprof"
    gods "github.com/emirpasic/gods"
)

func main() {
	var n,x,t int
	fmt.Scanf("%d %d %d", &n, &x, &t)
	fmt.Printf("%d\n", (n+x-1)/x * t)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n,x,t int
	fmt.Scanf("%d %d", &n, &x, &t)
	fmt.Printf("%d %s\n", (n+x-1)/x * t)
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	var n, x, t int
	_, _ = fmt.Scanf("%d %d %d", &n, &x, &t)
	result := int(math.Ceil(float64(x)/float64(t))) * n
	fmt.Println(result)
}
//  [ruby]
first = gets.split.map(&:to_i)
  n = first[0]
  x = first[1]
  t = first[2]
  number = n/x
  amari = n % x
  if amari == 0
    puts number*t
  else
    puts number*t+t
  end
//  [ruby]
n,x,t=gets.split.map(&:to_i)
tako=0
ans=0
while tako<n
    tako+=x
    ans+=t
end
puts ans
//  [ruby]
n,x,t=gets.split.map &:to_i
p (n+x-1)/x*t
//  [ruby]
line = gets.chomp.map(&:to_i)
#line = [1000, 1, 1000]
N, X, T = line

shortest_time = 0

if N <= X
    shortest_time = T
elsif N > X
    burn_time = N / X
    # 1
    if N % X != 0 # 8
        shortest_time = (burn_time * T) + T
    else
        shortest_time = T * burn_time
    end
end 

p shortest_time
//  [ruby]
a,b,c = gets.chomp.split(" ").map(&:to_i);
z=a%b
if z==0
p a/b*t
else
p a/b*c+c
end
//  [ruby]
n,x,t = gets.split.map(&:to_i)
puts (n / x + 1) * t
//  [rust]
use proconio::{input, fastout};

#[fastout]
fn main() {
    input! {
        n: usize,
        x: usize,
        t: usize,
    }

    let a = (n + (x - 1)) / x;
    println!("{}", a * t);
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        mut target: i32,
        mut every: i32,
        mut takes: i32
    }

    let mut answer = 0;
    loop {
        target -= every;
        answer += takes;

        if target <= 0 {
            break;
        }
    }

    println!("{}", answer);
}
//  [rust]
use proconio::*;

fn main() {
fn main() {
    input! {
        n: i32,
        x: i32,
        t: i32,
    }
    let ans =(n + x - 1) / x * t;
    println!("{}",ans);
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        n: u32,
        x: u32,
        t: u32,
    }
    let ans = if n % t == 0 {t * (n/x)}
              else {t * (n/x) + t};
    println!("{}", ans);
}
//  [swift]
let nxt = readLine()!.split(separator:" ").map{Int($0)!}
let n = nxt[0], x = nxt[1], t = nxt[2]
print(n%x==0 ? t*n/x : t*(n/x+1))
//  [swift]
let NXT = readLine()!.split(separator: " ").compactMap { Int($0) }

if NXT[0] % NXT[1] == 0 {
    print(NXT[0] / NXT[1] * NXT[2])
} else {
    print((NXT[0] / NXT[1] + 1) * NXT[2])
}
//  [swift]
func readThreeInts(separator: String.Element = " ") -> (a: Int, b: Int, c: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1], c: ints[2])
}

func mainA() {
    let (N, X, T) = readThreeInts()

    let full = N / X
    let remain = N % X

    print(full * T + (remain == 0 ? 0 : T))
}
mainA()
//  [swift]
let inp = readLine()!.split(separator: " ").map { Int($0)! }
let n = inp[0]
let x = inp[1]
let t = inp[2]
print(Int(ceil(Double(n) / Double(x))) * t)
//  [swift]

let inp = readLine()!.split(separator: " ").map { Int($0)! } let n = inp[0]
let x = inp[1]
let t = inp[2]
print(Int(ceil(Double(n) / Double(x))) * t)
//  [swift]
import Foundation
let inp = readLine()!.split(separator: " ").map { Int($0)! } let n = inp[0]
let x = inp[1]
let t = inp[2]
print(Int(ceil(Double(n) / Double(x))) * t)
//  [typescript]
import * as fs from "fs";

const input = fs
  .readFileSync("/dev/stdin", "utf8")
  .split(" ")
  .map(Number);

let ans = Math.ceil(input[0]/input[1])*input[2];

console.log(ans);
//  [typescript]
import * as fs from 'fs';

function main(input) {
  input = input.split("\n");
  const tmp = input[0].split(" ");
  const N = parseInt(tmp[0], 10);
  const X = parseInt(tmp[1], 10);
  const t = parseInt(tmp[2], 10);
  //出力
  console.log('%d', Math.ceil(N / X) * t);
  return 0;
}

main(fs.readFileSync("/dev/stdin", "utf8"));
//  [typescript]
function main(input) {
    const numberArray = input.split(' ');
   	const result = Math.ceil(numberArray[0] / numberArray[1]) * numberArray[2];
    console.log(result)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
import * as fs from 'fs';

function main(input) {
  // 1行目がinput[0], 2行目がinput[1], …に入る
  input = input.split("\n");
  const tmp = input[1].split(" ");
  const N = parseInt(tmp[0], 10);
  const X = parseInt(tmp[1], 10);
  const t = parseInt(tmp[2], 10);
  //出力
  console.log('%d', Math.ceil(N / X) * t);
}

main(fs.readFileSync("/dev/stdin", "utf8"));
//  [typescript]
import * as fs from 'fs'; 
function main(input: any[]) {
	const lines = input.split('\n');
  	const nxt = lines[1].split(' ');
	const n = nxt[0];
  	const x = nxt[1];
  	const t = nxt[2];
  	const answer = Math.ceil(n / x) * t; 
  	console.log(answer);
}

main(fs.readFileSync('/dev/stdin', 'utf8'));
//  [python]
def main():
    n, *v = map(int, open(0).read().split())
    be = [0] * int(1e5)
    bo = [0] * int(1e5)
    for e, o in zip(*[iter(v)] * 2):
        be[e - 1] += 1
        bo[o - 1] += 1
    ve = max(be)
    vo = max(bo)
    ke = be.index(ve)
    ko = bo.index(vo)
    if ke == ko:
        be[ke] = 0
        bo[ko] = 0
        print(min(n - ve - max(bo), n - vo - max(be)))
    else:
        print(n - ve - vo)
    return


main()
//  [python]
n = int(input())
nums = list(map(int, input().split()))
 
nums1 = nums[0::2]
nums2 = nums[1::2]
 
bug1 = [0] * 100001
bug2 = [0] * 100001
 
for num in nums1:
    bug1[num] += 1
 
for num in nums2:
    bug2[num] += 1
 
max_v_1 = max(bug1)
max_i_1 = bug1.index(max_v_1)
max_v_2 = max(bug2)
max_i_2 = bug2.index(max_v_2)
 
if max_i_1 == max_i_2:
    bug1[max_i_1] = 0
    bug2[max_i_2] = 0
    sec_max_v_1 = max(bug1)
    sec_max_v_2 = max(bug2)
    print(n - max(max_v_1, max_v_2) - max(sec_max_v_1, sec_max_v_2))
else:
    print(n - max_v_1 - max_v_2)
//  [python]
import itertools

n = int(input())
list_A = list(map(int, input().split()))
L, R = [], []
A, B = [[-1, 0], [-1, 0]]

for i in range(n):
    if i % 2 == 0:
        L.append(list_A[i])
    else:
        R.append(list_A[i])

L = itertools.groupby(L)
for key, group in L:
    A.append([key, len(list(group))])

A.sort(key=lambda x:x[1], reverse=True)

R = itertools.groupby(R)
for key, group in R:
    B.append([key, len(list(group))])

B.sort(key=lambda x:x[1], reverse=True)

if A[0][0] != B[0][0]:
    print(n - A[0][1] - B[0][1])
else:
    print(min(n - A[1][1] - B[0][1], n - A[0][1] - B[1][1]))
//  [python]
import itertools

n = int(input())
list_A = list(map(int, input().split()))
L, R = [], []
A, B = [[-1, 0]], [[-1, 0]]

for i in range(n):
    if i % 2 == 0:
        L.append(list_A[i])
    else:
        R.append(list_A[i])

L = itertools.groupby(L)
for key, group in L:
    A.append([key, len(list(group))])

A.sort(key=lambda x:(x[1], x[0]))

R = itertools.groupby(R)
for key, group in R:
    B.append([key, len(list(group))])

B.sort(key=lambda x:(x[1], x[1]), reverse=True)

if A[-1][0] != B[0][0]:
    print(n - A[-1][1] - B[0][1])
else:
    print(min(n - A[-2][1] - B[0][1], n - A[-1][1] - B[1][1]))
//  [python]
import itertools

n = int(input())
list_A = list(map(int, input().split()))
L, R = [], []
A, B = [[-1, 0]], [[-1, 0]]

for i in range(n):
    if i % 2 == 0:
        L.append(list_A[i])
    else:
        R.append(list_A[i])

L = itertools.groupby(L)
for key, group in L:
    A.append([key, len(list(group))])

A.sort(key=lambda x:(x[1], x[0]), reverse=True)

R = itertools.groupby(R)
for key, group in R:
    B.append([key, len(list(group))])

B.sort(key=lambda x:x[1], reverse=True)

if A[0][0] != B[0][0]:
    print(n - A[0][1] - B[0][1])
else:
    print(min(n - A[1][1] - B[0][1], n - A[0][1] - B[1][1]))
//  [java]
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;


	public class Main {
		
		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			
			int n = sc.nextInt();
			TreeMap<Integer,Integer> m1 = new TreeMap<Integer,Integer>();
			TreeMap<Integer,Integer> m2 = new TreeMap<Integer,Integer>();
			int sum1 = 0;
			int max11 = 0;
			int key11 = 0;
			int max12 = 0;
			int key12 = 0;
			
			int sum2 = 0;
			int max21 = 0;
			int key21 = 0;
			int max22 = 0;
			int key22 = 0;
			
			for(int i=0;i<n/2;i++) {
				m1.merge(sc.nextInt(), 1, Integer::sum);
				m2.merge(sc.nextInt(), 1, Integer::sum);
			}
			
			for(Map.Entry<Integer, Integer> e : m1.entrySet()) {
				sum1 += e.getValue();
				if(max11<=e.getValue()) {
					max12 = max11;
					max11 = Math.max(max11, e.getValue());
					key12 = key11;
					key11 = e.getKey();
				}
				
				if(max12<=e.getValue()) {
					max12 = Math.max(max12, e.getValue());
					key12 = e.getKey();
				}
				
				
			}
			
			for(Map.Entry<Integer, Integer> e : m2.entrySet()) {
				sum2 += e.getValue();
				if(max21<=e.getValue()) {
					max22 = max21;
					max21 = Math.max(max21, e.getValue());
					key22 = key21;
					key21 = e.getKey();
				}
				if(max22<=e.getValue()) {
					max22 = Math.max(max22, e.getValue());
					key22 = e.getKey();
				}
			}
			
			/*
			System.out.println(m1);
			System.out.println(m2);
			System.out.println(key11);
			System.out.println(key12);
			System.out.println(key21);
			System.out.println(key22);
			*/
			if(m1.size()==1&&m1.equals(m2)) {
				System.out.println(n/2);
			}else {
				if(key11!=key21) {
					System.out.println(sum1+sum2-m1.get(key11)-m2.get(key21));
				}else {
					if(m1.get(key11)+m2.get(key22)>m1.get(key12)+m2.get(key21)) {
						System.out.println(sum1+sum2-m1.get(key11)-m2.get(key22));
					}else {
						System.out.println(sum1+sum2-m1.get(key12)-m2.get(key21));
					}
				}
			}
			
			
			
	    }
		
	}
//  [java]
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;


	public class Main {
		
		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			
			int n = sc.nextInt();
			TreeMap<Integer,Integer> m1 = new TreeMap<Integer,Integer>();
			TreeMap<Integer,Integer> m2 = new TreeMap<Integer,Integer>();
			int sum1 = 0;
			int max11 = 0;
			int key11 = 0;
			int max12 = 0;
			int key12 = 0;
			
			int sum2 = 0;
			int max21 = 0;
			int key21 = 0;
			int max22 = 0;
			int key22 = 0;
			
			for(int i=0;i<n/2;i++) {
				m1.merge(sc.nextInt(), 1, Integer::sum);
				m2.merge(sc.nextInt(), 1, Integer::sum);
			}
			
			for(Map.Entry<Integer, Integer> e : m1.entrySet()) {
				sum1 += e.getValue();
				if(max11<=e.getValue()) {
					max12 = max11;
					max11 = Math.max(max11, e.getValue());
					key12 = key11;
					key11 = e.getKey();
				}
				
			}
			
			for(Map.Entry<Integer, Integer> e : m2.entrySet()) {
				sum2 += e.getValue();
				if(max21<=e.getValue()) {
					max22 = max21;
					max21 = Math.max(max21, e.getValue());
					key22 = key21;
					key21 = e.getKey();
				}
			}
			
			//System.out.println(m1);
			//System.out.println(m2);
			
			if(m1.size()==1&&m1.equals(m2)) {
				System.out.println(n/2);
			}else {
				if(key11!=key21) {
					System.out.println(sum1+sum2-m1.get(key11)-m2.get(key21));
				}else {
					if(m1.get(key11)+m2.get(key22)>m1.get(key12)+m2.get(key21)) {
						System.out.println(sum1+sum2-m1.get(key11)-m2.get(key22));
					}else {
						System.out.println(sum1+sum2-m1.get(key12)-m2.get(key21));
					}
				}
			}
			
			
			
	    }
		
	}
//  [java]
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;


	public class Main {
		
		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			
			int n = sc.nextInt();
			TreeMap<Integer,Integer> m1 = new TreeMap<Integer,Integer>();
			TreeMap<Integer,Integer> m2 = new TreeMap<Integer,Integer>();
			int sum1 = 0;
			int max11 = 0;
			int key11 = 0;
			int max12 = 0;
			int key12 = 0;
			
			int sum2 = 0;
			int max21 = 0;
			int key21 = 0;
			int max22 = 0;
			int key22 = 0;
			
			for(int i=0;i<n/2;i++) {
				m1.merge(sc.nextInt(), 1, Integer::sum);
				m2.merge(sc.nextInt(), 1, Integer::sum);
			}
			
			for(Map.Entry<Integer, Integer> e : m1.entrySet()) {
				sum1 += e.getValue();
				if(max11<=e.getValue()) {
					max12 = max11;
					max11 = Math.max(max11, e.getValue());
					key12 = key11;
					key11 = e.getKey();
				}
				
			}
			
			for(Map.Entry<Integer, Integer> e : m2.entrySet()) {
				sum2 += e.getValue();
				if(max21<=e.getValue()) {
					max22 = max21;
					max21 = Math.max(max21, e.getValue());
					key22 = key21;
					key21 = e.getKey();
				}
			}
			
			System.out.println(m1);
			System.out.println(m2);
			
			if(m1.size()==1&&m1.equals(m2)) {
				System.out.println(n/2);
			}else {
				if(key11!=key21) {
					System.out.println(sum1+sum2-m1.get(key11)-m2.get(key21));
				}else {
					if(m1.get(key11)+m2.get(key22)>m1.get(key12)+m2.get(key21)) {
						System.out.println(sum1+sum2-m1.get(key11)-m2.get(key22));
					}else {
						System.out.println(sum1+sum2-m1.get(key12)-m2.get(key21));
					}
				}
			}
			
			
			
	    }
		
	}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(int x){
  char f[10];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
template<class S, class T> inline S chmax(S &a, T b){
  if(a<b){
    a=b;
  }
  return a;
}
int N;
int A[100000];
int cnt1[100000];
int cnt2[100000];
int main(){
  int i, m1, m2, res;
  rd(N);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=0;Lj4PdHRW<N;Lj4PdHRW++){
      rd(A[Lj4PdHRW]);A[Lj4PdHRW] += (-1);
    }
  }
  for(i=0;i<N;i+=2){
    cnt1[A[i]]++;
  }
  for(i=1;i<N;i+=2){
    cnt2[A[i]]++;
  }
  {
    int FmcKpFmN, Q5VJL1cS, RZTsC2BF, cTE1_r3A, e98WHCEY=0;
    for(Q5VJL1cS=0;Q5VJL1cS<((100000)-1)+1;Q5VJL1cS++){
      RZTsC2BF = cnt1[Q5VJL1cS];
      if(e98WHCEY==0 || cTE1_r3A<RZTsC2BF){
        cTE1_r3A = RZTsC2BF;
        e98WHCEY = 1;
        FmcKpFmN = Q5VJL1cS;
      }
    }
    m1 =FmcKpFmN;
  }
  {
    int KrdatlYV, WYIGIcGE, ao_dF3pO, tU__gIr_, t_ynMSdg=0;
    for(WYIGIcGE=0;WYIGIcGE<((100000)-1)+1;WYIGIcGE++){
      ao_dF3pO = cnt2[WYIGIcGE];
      if(t_ynMSdg==0 || KrdatlYV<ao_dF3pO){
        KrdatlYV = ao_dF3pO;
        t_ynMSdg = 1;
        tU__gIr_ = WYIGIcGE;
      }
    }
    m2 =tU__gIr_;
  }
  res = 0;
  for(i=0;i<100000;i++){
    if(i!=m1){
      chmax(res, cnt1[m1] + cnt2[i]);
    }
  }
  for(i=0;i<100000;i++){
    if(i!=m2){
      chmax(res, cnt1[i] + cnt2[m2]);
    }
  }
  res = N - res;
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190721-1

// --- original code ---
// int N, A[1d5];
// 
// int cnt1[1d5], cnt2[1d5];
// {
//   int i, m1, m2, res;
//   rd(N,(A--)(N));
// 
//   for(i=0;i<N;i+=2) cnt1[A[i]]++;
//   for(i=1;i<N;i+=2) cnt2[A[i]]++;
//   m1 = argmax(cnt1(1d5));
//   m2 = argmax(cnt2(1d5));
// 
//   res = 0;
//   rep(i,1d5) if(i!=m1) res >?= cnt1[m1] + cnt2[i];
//   rep(i,1d5) if(i!=m2) res >?= cnt1[i] + cnt2[m2];
//   res = N - res;
// 
//   wt(res);
// }
//  [cpp]
#include<cstdio>
#include<cstring>
#include<algorithm>
int Min(int a,int b){return a<b?a:b;}
int Max(int a,int b){return a>b?a:b;}
inline int read()
{
	int x=0,f=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
	while(c>='0'&&c<='9'){x=(x<<3)+(x<<1)+c-'0';c=getchar();}
	return x*f;
}
int n,v[100005],num[100005],ans,m1,m2,M1,M2,b1,b2,B1,B2;
int main()
{
	n=read();
	for(int i=1;i<=n;i++) v[i]=read();
	for(int i=1;i<=n;i+=2) num[v[i]]++;
	for(int i=1;i<=100000;i++)
	{
		if(num[i]>=m2)
		{
			if(num[i]>=m1)
			{
				m2=m1;b2=b1;
				m1=num[i];b1=i;
			}
			else{m2=num[i];b2=i;}
		}
	}
//	printf("%d\n",m);
	memset(num,0,sizeof num);
	for(int i=2;i<=n;i+=2) num[v[i]]++;
	for(int i=1;i<=100000;i++)
	{
		if(num[i]>=M2)
		{
			if(num[i]>=M1)
			{
				M2=M1;B2=B1;
				M1=num[i];B1=i;
			}
			else{M2=num[i];B2=i;}
		}
	}
	//printf("%d %d %d %d\n",m1,m2,M1,M2);
	if(b1!=B1) printf("%d",n-M1-m1);
	else
	{
		if(M2>0&&m2>0) return 0*printf("%d",n-Max(m1+M2,m2+M1));
		if(M2>0) return 0*printf("%d",n-m1-M2);
		if(m2>0) return 0*printf("%d",n-m2-M1);
		printf("%d",n>>1);
	}
}
//  [cpp]
#include<set>
#include<map>
#include<ctime>
#include<queue>
#include<cmath>
#include<climits>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
int read(){
    int f=1,x=0;char s=getchar();   
    while(s<'0'||s>'9'){if(s=='-')f=-1;s=getchar();}  
    while(s>='0'&&s<='9'){x=x*10+s-'0';s=getchar();}
    return x*f;
}
#define MAXN 100000
#define INF 0x3f3f3f3f
int cnt[2][MAXN+5];
int main(){
	int v,n=read();
	for(int i=1;i<=n;i++)
		v=read(),cnt[i%2][v]++;
	int Maxa1=0,Maxa2=0,Maxb1=0,Maxb2=0;
	for(int i=0;i<=MAXN;i++){
		if(cnt[1][Maxa1]<cnt[1][i])
			Maxa2=Maxa1,Maxa1=i;
		else if(cnt[1][Maxa2]<cnt[1][i])
			Maxa2=i;
		if(cnt[0][Maxb1]<cnt[0][i])
			Maxb2=Maxb1,Maxb1=i;
		else if(cnt[0][Maxb2]<cnt[0][i])
			Maxb2=i;
	}
	if(Maxa1!=Maxb1)
		printf("%d\n",n-cnt[1][Maxa1]-cnt[0][Maxb1]);
	else printf("%d\n",n-max(cnt[1][Maxa1]+cnt[0][Maxb2],cnt[1][Maxa2]+cnt[0][Maxb1]));
	return 0;
}
//  [cpp]
/* BISMILLAHIR RAHMANIR RAHIM */
#include<bits/stdc++.h>
using namespace std;
#define ll        long long
#define ull       unsigned long long
#define sd(x)     scanf("%lf", &x)
#define l0(i,n)   for(ll i=0; i<n; i++)
#define MAX       100005
#define maxn 	  200005
#define pb 		  push_back
#define mk 		  make_pair
#define endl	  "\n"
#define INF 	  1000000000
#define MOD		  1000000007
#define imie(...) "[" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "


int main()
{
	int n;
	cin >> n;
	vector <int> a(n);
	for (auto &x : a) cin >> x;
	set<int> s;
	for (auto x : a)
		s.insert(x);
	if(s.size()==1)
	{
		cout << n/2 << endl;
		return 0;
	}
	else
	{
		cout << s.size() - 2 << endl;
	}
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const long long INF = 1LL << 60;
const ll C = 1000000000+7;

int main() {
    int N;
    cin >> N;
    vector<int> odd(100005), even(100005);
    for(int i=1; i<=N; i++) {
        int v;
        cin >> v;
        if(i%2 == 0) {
            odd[v]++;
        }
        else {
            even[v]++;
        }
    }

    vector<int>::iterator iter = max_element(odd.begin(), odd.end());
    int oindex = distance(odd.begin(), iter);
    vector<int>::iterator e_iter = max_element(even.begin(), even.end());
    int eindex = distance(even.begin(), e_iter);

    sort(odd.begin(), odd.end());
    reverse(odd.begin(), odd.end());
    sort(even.begin(), even.end());
    reverse(even.begin(), even.end());

    if(oindex == eindex) {
        cout << (N/2) - odd[1] + (N/2) - even[0] << endl;
        return 0;
    }
    cout << (N/2) - odd[0] + (N/2) - even[0];
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define all(x) x.begin(), x.end()
using ll = long long;
using pii = pair<int, int>;
const int mod = 1e9+7;

template<class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

int main() {
    int n;
    cin >> n;
    vector<int> v(n);
    rep(i, n) {
        cin >> v[i];
    }
    map<int, int> m1, m2;
    int a1 = 0, a2 = 0;
    int x1, x2;
    for (int i = 0; i < n; i += 2) {
        m1[v[i]]++;
        if (chmax(a1, m1[v[i]])) x1 = v[i];
    }
    for (int i = 1; i < n; i += 2) {
        m2[v[i]]++;
        if (chmax(a2, m2[v[i]])) x2 = v[i];
    }
    int ans;
    if (x1 != x2) {
        ans = n - a1 - a2;
    } else  {
        ans = n - a2;
    }
    cout << ans << endl;
}
//  [c]
#include<stdio.h>

int odd[100001];
int even[100001];
int n, odd1, odd2, even1, even2, i;
char c;

int max(int a, int b);
int nextInt();

int main(){
	n = nextInt();
	for(i=0; i<n; i+=2){
		odd[nextInt()]++;
		even[nextInt()]++;
	}
	for(i=0; i<100001; i++){
		if(odd[i] > odd[odd1]){
			odd2 = odd1;
			odd1 = i;
		}else if(odd[i] > odd[odd2]){
			odd2 = i;
		}
		if(even[i] > even[even1]){
			even2 = even1;
			even1 = i;
		}else if(even[i] > even[even2]){
			even2 = i;
		}
	}
	if(odd1 == even1){
		i = max(odd[odd1]+even[even2], odd[odd2]+even[even1]);
	}else{
		i = odd[odd1]+even[even1];
	}
	printf("%d", n-i);
	return 0;
}

int max(int a, int b){
	return (a<b?b:a);
}

int nextInt(){
	int f=0;
	c= getchar();
	while((c<'0')||('9'<c)){
		c=getchar();
	}
	while((c>='0')&&(c<='9')){
		f=f*10+(c-'0');
		c=getchar();
	}
	return f;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
  int n,v[100005],w[100005],elem1[100005]={},elem2[100005]={},i,k=0,l=0,max1,max2,a,b;
  int maxvalue1,maxvalue2,num1=0,num2=0,next,nextvalue,next1,nextvalue1,answer,minanswer;
  char str[1000000],*p;
  
  fgets(str,sizeof(str),stdin);
  n=atoi(str);
  
  fgets(str,sizeof(str),stdin);
  p=strtok(str," \n");
  v[l]=atoi(p),l++,num1=v[0];
  for(i=1;i<n;i++){
    p=strtok(NULL," \n");
    if(i%2==1){
      w[k]=atoi(p);
      if(num2<w[k]){
        num2=w[k];
      }
      k++;
    }else{
      v[l]=atoi(p);
      if(num1<v[l]){
        num1=v[l];
      }
      l++;
    }
  }
  
  for(i=0;i<n/2;i++){
    elem1[v[i]]++;
  }
  for(i=0,max1=0,maxvalue1=0,next1=0,nextvalue1=0;i<=num1;i++){
    if(max1<=elem1[i]){
      next1=max1,nextvalue1=maxvalue1,max1=elem1[i],maxvalue1=i;
    }else if(next1<elem1[i]){
      next1=elem1[i],nextvalue1=i;
    }
  }
  for(i=0;i<n/2;i++){
    elem2[w[i]]++;
  }
  for(i=0,max2=0,maxvalue2=0,next=0,nextvalue=0;i<=num2;i++){
    if(max2<elem2[i]){
      next=max2,nextvalue=maxvalue2,max2=elem2[i],maxvalue2=i;
    }else if(max2<=elem2[i] && i!=maxvalue1){
      next=max2,nextvalue=maxvalue2,max2=elem2[i],maxvalue2=i;
    }else if(next<elem2[i]){
      next=elem2[i],nextvalue=i;
    }
    
  }
  
  if(maxvalue1!=maxvalue2){
    answer=n-max1-max2;
    minanswer=answer;
    printf("%d\n",minanswer);
    return 0;
  }
  if(maxvalue1==maxvalue2){
    a=n-max1-next;
    b=n-next1-max2;
    if(a<b){
      minanswer=a;
    }else{
      minanswer=b;
    }
  }
  
  printf("%d\n",minanswer);
  
  return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int a[10001];
  int n,cnt=0;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
  }  
  for(int i=0;i<n-2;i++){
    if(a[i] != a[i+2]){
      cnt++;
    }
  }
  if(cnt == n-2){
    printf("%d",n/2);
  }else if(cnt == 0){
    printf("%d",0);
  }else{
    printf("%d",cnt);
  }
  return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int a[10001];
  int n,cnt=0;
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
  }  
  for(int i=0;i<n-2;i++){
    if(a[i] != a[i+2]){
      cnt++;
    }
  }
  if(cnt == n-2){
    printf("%d",n/2);
  }else if(cnt == 0){
    printf("%d",0);
  }else{
    printf("%d",cnt);
  }
  return 0;
}
//  [c]
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
typedef long long ll;

// cant imp

int main() {
    cin.tie(0);
    cin.sync_with_stdio(0);
    
    int n, v;
    cin >> n;
    vector<int> ecnt(100001, 0), ocnt(100001, 0);
    for (int i = 0; i < n; i++) {
        scanf("%d", &v);
        if (i % 2 == 0) ecnt[v]++;
        else ocnt[v]++;
    }

    int max_ecnt = 0, max_ocnt = 0;
    int max_e = 0, max_o = 0;
    for (int i = 0; i < 100001; i++) {
        if (max_ecnt < ecnt[i]) {
            max_ecnt = ecnt[i];
            max_e = i;
        }
        if (max_ocnt < ocnt[i]) {
            max_ocnt = ocnt[i];
            max_o = i;
        }
    }

    int ans;
    if (max_o == max_e) {
        sort(ecnt.begin(), ecnt.end(), greater<int>());
        sort(ocnt.begin(), ocnt.end(), greater<int>());
        int t1 = n - max_ecnt - ocnt[1];
        int t2 = n - ecnt[1] - max_ocnt;
        ans = min(t1, t2);
    } else {
        ans = n - max_ocnt - max_ecnt;
    }

    cout << ans << endl;
}