jiahuimbzuai/CoQuIR huggingface dataset:
//  [cpp]
#include <iostream>
#include <cstdio>
#include <cstring>
#include <climits>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <sstream>
#include <numeric>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

///////////////////////////////////////////////////////////////
// namespace
///////////////////////////////////////////////////////////////
using namespace std;
namespace mp = boost::multiprecision;

///////////////////////////////////////////////////////////////
// types
///////////////////////////////////////////////////////////////
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using mpi = mp::cpp_int;
using mpf = mp::number<mp::cpp_dec_float<1024>>;

///////////////////////////////////////////////////////////////
// mod https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a
///////////////////////////////////////////////////////////////
// ll MOD = 1000000007;
//
// ll mod(long long val) {
//     long long res = val % MOD;
//     if (res < 0) res += MOD;
//     return res;
// }
//
// ll modinv(ll a) {
//     ll b = MOD, u = 1, v = 0;
//     while (b) {
//         ll t = a / b;
//         a -= t * b; swap(a, b);
//         u -= t * v; swap(u, v);
//     }
//     u %= MOD;
//     if (u < 0) u += MOD;
//     return u;
// }
//
// const int MAX = -1;
// ll fac[MAX], finv[MAX], inv[MAX];
// void com_init() {  // initialize nCk table with O(N)
//     fac[0] = fac[1] = 1;
//     finv[0] = finv[1] = 1;
//     inv[1] = 1;
//     for (int i = 2; i < MAX; i++){
//         fac[i] = fac[i - 1] * i % MOD;
//         inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
//         finv[i] = finv[i - 1] * inv[i] % MOD;
//     }
// }
// ll com(int n, int k){  // nCk
//     if (n < k) return 0;
//     if (n < 0 || k < 0) return 0;
//     return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
// }


int main() {
    string y; cin >> y;
    mpf x(y);
    int c = 0;
    mpf m(100.0);
    while (m < x) {
        ++c;
        m *= mpf(1.01);
        mpi tmp(m);
        m = mpf(tmp);
        // cout << m << endl;
    }
    cout << c << endl;
    return 0;
}
//  [c]
#include <stdio.h>

int main()
{
  double A = 100.0;
  long long int x;
  double X;
  int i;
  int j;
  long long int temp;
  scanf("%lf", &X);
  
  for(i = 1; /**/ ; ++i){
    A = 100.0;
    for(j = 0; j < i; ++j){
      A *= 1.01;
      temp = (long long int)A;
      A = (double)temp;
    }
    //printf("%lf, %lf\n", A, X);
    if(A >= X){
      printf("%d\n", i);
      return 0;
    }
  }
}
//  [c]
#include <stdio.h>
#include <math.h>

int main(void){
  long long int a=100,x,i;
  
  scanf("%lld", &x);
  
  for(i=0;;i++){
    if(a>=x){break;}
    a=floor(1.01*(double)a);
  }
  printf("%lld", i);
  
  
  return 0;
}
//  [c]
#include<stdio.h>

void main(){
  long long int x, money=100, year=0;
  scanf("%lld",&x);
  
  while(x>money){
    money *= 1.01;
    year++;
  }
  printf("%lld",year);
}
//  [javascript]
function main(input){
  input = input.split('\n');
  const X = BigInt(input[0]);

  let sum = 100n;
  let years = 0;
  while(sum < X){
    let rishi = sum/100n;
    sum += BigInt(String(rishi).split('.')[0]);
    years++;
  }

  console.log(years)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
//  [javascript]
const main = (input) => {
  const X = BigInt(input.trim())
  let saving = 100n
  let ans = 0

  while (saving < X) {
    saving = saving * 101n / 100n
    ans++
  }

  return console.log(ans)
}

process.env.MYTEST ? test() : main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
function Main(input) {
  let deposit = 100;
  input = parseInt(input);

  let count = 0;

  while(deposit < input){
    deposit += Math.floor(deposit * 0.01);
    count++
  }

  console.log(count)
}

// Don't edit this line!
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import "fmt"

func main() {
	risi := 1
	var x int
	fmt.Scan(&x)

	val := 100
	year := 0
	for val < x {
		val = val + val*risi/100
		year++
	}
	fmt.Println(year)
}
//  [go]
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	money := 100
	count := 0
	for{
		money = int(float64(money) * 1.01)
		count++
		if money >= n{
			fmt.Println(count)
			break
		}
	}
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

	return int64(i)
}
func main() {
	sc.Split(bufio.ScanWords)
	x := big.NewInt(nextInt64())
	now := big.NewInt(100)
	cnt := 0

	for {
		compares := x.Cmp(now)
		if (compares == -1) || (compares == 0) {
			fmt.Println(cnt)
			return
		}
		now.Mul(now, big.NewInt(101))
		now.Div(now, big.NewInt(100))
		cnt++
	}

}
//  [ruby]
X = STDIN.read.to_i

def cal(n)
  return (100 * 1.01).floor if n == 1

  (1.01 * cal(n-1)).floor
end

1.upto(1000000000000000000) do |i|
  if cal(i) >= X
    print i
    exit
  end
end
//  [ruby]
require "bigdecimal"
x = gets.chomp.to_i
cnt = 0
a = 100
while x > 100 
	if a >= x then
		puts cnt 
		exit
	end
	cnt += 1
	a = (a*1.01).to_i
end
//  [ruby]
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
x = gets.chomp.to_i

current = 100
ans = 0
while current < x
  current = (current * 1.01).to_i
  ans += 1
end

puts ans
//  [rust]
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}
macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let x: i64 = sc.cin();
    let mut r = 100;
    for i in 0..1000000 {
        r += r / 100;
        trace!(i, r);
        if r >= x {
            put!(i + 1);
            return;
        }
    }
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> { self.cin::<String>().chars().collect() }
    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> { (0..n).map(|_| self.cin()).collect() }
}
//  [swift]
import Foundation

let  X = Int(readLine()!)!
var price: Int = 100

for i in 1...10000 {
    price = price + price / 100
    if price >= X {
        print(i)
        break
    }
    
}
//  [swift]
import Foundation

func + (lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> NSDecimalNumber {
    return lhs.adding(rhs)//.decimalNumberByAdding(rhs)
}

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

func main(){
    let input = Int(readLine()!)!
    var deposit = 100
    
    for i in 1...Int(pow(10.0, 18.0)){
        deposit += deposit / 100
        if deposit >= input{
            print(i)
            return
        }
    }

}
main()
//  [swift]
// let x = cin.double
// var c = 100.0
// var y = 0

// while x > c {
//     y += 1
//     c = floor(c * 1.01)
// }
// 974755271730884810
// 3758

let x = cin.int
var c = 100
var y = 0

while x > c {
    y += 1
    c = c + c/100
}

print(y)

import Foundation
#if os(Linux)
    import Glibc
#else
    import Darwin.C
#endif

enum cin {
    // 123
    static var int: Int { Int(readLine()!)! }
    // 123.0
    static var double: Double { Double(readLine()!)! }
    // 12 23
    static var pair: (Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!) }
    // 12 23 34
    static var triple: (Int, Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!, Int(line[2])!) }
    // AtCoder
    static var str: String { readLine()! }
    // At Coder
    static var arrayStr: [String] { str.components(separatedBy: " ") }
    // 1 2 3 4
    static var array: [Int] { str.components(separatedBy: " ").map { Int($0)! } }
    // 1
    // 2
    // 3
    static func v_array(count: Int) -> [Int] { (0..<count).map { _ in int } }
}

extension Int {
    // 123 -> [1, 2, 3]
    var digits: [Int] { Array(String(self)).map { Int(String($0))! } }
}

extension Array where Element == Int {
    // [2, 1, 3, 2] -> 8
    var sum: Int { self.reduce(0, +) }
    // [2, 1, 3, 2] -> [1, 2, 2, 3]
    var orderBy: [Int] { sorted() }
    // [2, 1, 3, 2] -> [3, 2, 2, 1]
    var orderByDesc: [Int] { sorted(by: { $0 > $1 }) }
    // [2, 1, 3, 2] -> [2, 1, 3]
    var distinct: [Int] { Array(Set(self)) }
}

extension String {
    // e.g. cin.line.regex(match: "^(dream|dreamer|erase|eraser)*$")
    func regex(match pattern: String) -> Bool {
        let regex = try! NSRegularExpression(pattern: pattern)
        return regex.firstMatch(in: self, range: NSRange(location: 0, length: self.count)) != nil
    }
    // "ABC"[1] -> "B"
    subscript(i: Int) -> Character {
        get {
            self[index(at: i)]
        }
        set(char) {
            var characters = Array(self)
            characters[i] = char
            self = String(characters)
        }
    }
    func index(at offset: Int) -> String.Index { index(startIndex, offsetBy: offset) }
    // "ABC".swapAt(0, 1) -> "BAC"
    mutating func swapAt(_ index1: Int, _ index2: Int) {
        var characters = Array(self)
        characters.swapAt(index1, index2)
        self = String(characters)
    }
}
//  [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 (true) {
    deposit += deposit / 100n;
    years += 1;

    if (deposit >= X) {
      return years;
    }
  }
};

console.log(main(read()));
//  [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()));
//  [python]
N,X,T=map(int,input().split())
ans=(N+X-1)//X
from time import sleep
sleep(1.95)
print(ans*T)
//  [python]
import sys
import numba
from numba import jit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@jit
def main(n, x, t):
  if n%x == 0:
    return (n//x)*t
  else:
    return (n//x+1)*t

n, x, t = map(int, readline().split())
print(main(n, x, t))
//  [python]
import math
from decimal import *
import random

def pf(n):
    ans = [1]
    if(n%2==0):
        if(n!= 2):
            ans.append(2)
        while(n%2==0):
            n//=2
    p = 3
    while(n>1):
        if(n%p==0):
            ans.append(p)
            while(n%p==0):
                n//=p
        p+=1
    return ans

n,x,k = map(int, input().split())
print(math.ceil(n/x)*k)
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// AtCoder_A
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int X = sc.nextInt();
		int T = sc.nextInt();
		// 出力
		int times = (N-1)/ X + 1;
		System.out.println(times * T);
	    // Scannerクラスのインスタンスをクローズ
		sc.close();
	}
}
//  [java]
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int x = s.nextInt();
		int t = s.nextInt();
		
		System.out.println((int)Math.ceil((double)n/(double)x) * t);
		

	}

}
//  [java]
import java.util.*;
    public class Main {
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            double a = sc.nextInt();
            double b = sc.nextInt();
            int c = sc.nextInt();
            double d = Math.ceil(a/b);
            System.out.println((int)d * c);
        }
    }
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define pi 2*asin(1.0)
#define MAX 10000000
#define MOD 1000000007
 
 
vector<long> fac(MAX);
vector<long> finv(MAX);
vector<long> inv(MAX);
 
//template functions
/////////////////////////
void Cominit(){
  fac.at(0)=fac.at(1)=1;
  finv.at(0)=finv.at(1)=1;
  inv.at(1)=1;
  for(long i=2;i<MAX;i++){
      fac.at(i)=(fac.at(i-1)*i)%MOD;
      inv.at(i)=MOD-inv.at(MOD%i)*(MOD/i)%MOD;
      finv.at(i)=finv.at(i-1)*inv.at(i)%MOD;
  }
}

long facComb(long N,long M){// nCm%
if(N<M) return 0;
if(N<0||M<0) return 0;
return fac.at(N)*(finv.at(M)*finv.at(N-M)%MOD)%MOD;
}

long Comb(long N,long M){// nCm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
for(long i=M;i>0;i--){
    ans=ans/i;
}
return ans;
}

long Perm(long N,long M){// nPm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
return ans;
}

long GCM(long A,long B){
            long W,r;
    if(A<B){

        W=B;
        B=A;
        A=W;
    }
    while(A%B!=0){
        r=A%B;
        A=B;
        B=r;
    }
    return B;
}
long LCM(long A,long B){
    return (A*B)/GCM(A,B);
}

long upDiv(long a,long b){
  return (a+b-1)/b;
}

/////////////////////////


//Answer


int main() {

long N,X,T;
cin>>N>>X>>T;
long c=upDiv(N,X);
cout<<c*T<<endl;



}
//  [c]
#include <stdio.h>
#include <unistd.h>

int main(void) {
    usleep(1.999 * 1000000);
	
  	int n, x, t; scanf("%d %d %d", &n, &x, &t);
  	int sum = 0, ans = 0;
    for(int i = 0; 1 ;i++) {
    	sum += x;
      	ans += t;
      	if (sum >= n) {
          break;
        }
    }
  	printf("%d\n", ans);
}
//  [c]
#include<stdio.h>
void main()
{
  int n,m,t,i,a,b,c;
  scanf("%d %d %d",&n,&m,&t);
  for(i=1;i>0;i++)
  {
    a=i*m;
    b=n-a;
    if(b<=0)
    {
     break;
    }
  }
 c=i*t;
  printf("%d",c);
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define true 1
#define false 0
typedef long long ll;
typedef unsigned char Uchar; 

int main(void){

int i,j;
int n,x,t;
scanf("%d %d %d",&n,&x,&t);

  int a = n % x;
  int b = n / x;
  
  int c;
  if(a==0){
   c = b*t; 
  }else c = (b+1) * t;
  
  
printf("%d\n",c);

return 0;
}
//  [javascript]
const main = (input) => {
  const [n, x, t] = input.trim().split(' ').map(Number)
  return console.log(Math.ceil(n/x) * t)
}

process.env.MYTEST ? test() : main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	[N, X, T] = input.split(" ");
  	result=Math.ceil(N/X)*T
	console.log(result)
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
	let[N,X,T] = input.split(" ");
  	N = Number(N)
 	X = Number(X)
  	T = Number(T)
  	
  	const reminder = N%X
    const quotient = Math.floor(N/X)
    
    if(reminder==0){
    	console.log(quotient*T)
    }else{
      	console.log((quotient+1)*T)
    }
	
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024*1024), bufio.MaxScanTokenSize)
}

//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 nextUint64() uint64 {
//	sc.Scan()
//	i, e := strconv.ParseUint(sc.Text(), 10, 64)
//	if e != nil {
//		panic(e)
//	}
//	return i
//}

func main() {
	n := nextInt()
	x := nextInt()
	t := nextInt()

	c := n / x
	r := n % x

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

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

// -----------------------------------------------------------------------------
// IO functions

var r = bufio.NewReader(os.Stdin)
var w = bufio.NewWriter(os.Stdout)

func nb() []byte {
	b, err := r.ReadBytes(' ')
	if err != nil {
		panic(err)
	}
	return b
}

func ns() string {
	s, err := r.ReadString(' ')
	if err != nil {
		panic(err)
	}
	return s
}

func nl() int64 {
	var ll int64
	fmt.Fscan(r, &ll)
	return ll
}

func ni() int {
	var ll int
	fmt.Fscan(r, &ll)
	return ll
}

func nf() float64 {
	var ff float64
	fmt.Fscan(r, &ff)
	return ff
}

// -----------------------------------------------------------------------------
// Simple math functions

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}
func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func abs64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// =============================================================================

func main() {
	defer w.Flush()

	n := ni()
	x := ni()
	t := ni()
	fmt.Fprintf(w, "%d\n", (n+x-1)/x*t)
}

// =============================================================================
//  [ruby]
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
n,x,t = gets.chomp.split.map(&:to_i)
k = n / x
k += 1 if n%x!=0
puts k * t
//  [ruby]
#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def sum(a) a.inject(:+) end

def big(a,b) return (a>b)? a:b end

def small(a,b) return (a<b)? a:b end

#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def sum(a) a.inject(:+) end

def big(a,b) return (a>b)? a:b end

def small(a,b) return (a<b)? a:b end

n , x ,y = inp
p ((n+x-1)/x)*y
//  [ruby]
require 'pp'

###################

inputType = :singleLine
# inputType = :2Lines
# inputType = :nLines
  
def main(query)
  ppp("hoge", query)
  n,x,t = tois(query[0].split(" "))
  t2 = t * (n / x)
  if (n % x > 0) then
    t2 = t2 + t
  end
  return [t2]
end

###################

TEST=false

def tois(l)
  l.map { | x | x.to_i}
end

def ppp(msg, val)
  if (TEST) then
    print msg
    pp val
  end
end

target = nil
if (ARGV.size == 0) then
  f = STDIN
end
if (ARGV.size > 0) then
  f = open(ARGV[0])
end
if (ARGV.size > 1) then
  target = ARGV[1].to_i
end

t = 1
ng = []
while true
  query = []
  if (inputType == :singleLine) then
    a = f.gets
    if ! a then
      exit
    end
    a.chomp!
    query.push a
  elsif (inputType == :l2Lines) then
    a = f.gets
    if ! a then
      exit
    end
    a.chomp!
    query.push a
    b = f.gets.chomp
    query.push b
  elsif (inputType == :l3Lines) then
    a = f.gets
    if ! a then
      exit
    end
    a.chomp!
    query.push a
    b = f.gets.chomp
    query.push b
    c = f.gets.chomp
    query.push c
  elsif (inputType == :nLines) then
    a = f.gets
    if ! a then
      exit
    end
    a.chomp!
    query.push a    

    n = a.split(" ")[2].to_i

    query = n.times { | i |
      query.push f.gets.chomp
    }    
  end
  
  aa = f.gets
  if ! aa then
    r = main(query) 
    r.each { | x | puts x }
    exit
  elsif ( aa.chomp == "---") then
    oks = []
    while true
      s = f.gets.chomp
      if (s == "===") then
        break
      end
      oks.push s
    end

    if (target == nil || t == target) then
      if target then
        TEST = true
      end

      puts "--- " + t.to_s + " ---"
      r = main(query)    

      if r.join('\n') == oks.join('\n') then
        puts "RESULT:"
        r.each { | x | puts x }
        puts "OK"
      else
        puts "RESULT:NG"
        r.each { | x | puts x }
        puts "NG!!!!!!!!!"
        ng.push t
      end
    end
  end
  t = t + 1
end
puts "---"
puts "NG targes = " + ng.to_s
//  [swift]
import Foundation

let input = readLine()!.components(separatedBy: " ")
let n = Double(input[0])!
let x = Double(input[1])!
let t = Double(input[2])!
let result = ceil(n / x) * t
print(Int(result))
//  [swift]
import Foundation
 
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
 
let N = Double(split[0])!
let X = Double(split[1])!
let T = Int(split[2])!


print(Int(ceil(N/X)) * T)
//  [swift]
// 🐋💭
import Foundation

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

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

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

func readDouble() -> Double{
    return Double(readLine()!)!
}

func readLines() -> [String] {
    return readLine()!.map { String($0) }
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}

///最大公約数を返す
func gcd(_ array: [Int]) -> Int {
    var value = array[0]
    if array.count > 1 {
        for i in 1..<array.count {
            value = gcd(value, array[i])
        }
    }
    return value
}

///最小公倍数を返す
func lcm(_ m:Int, _ n:Int) -> Int {
    return m * n / gcd(m, n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {
    
    mutating func remove(_ element: Element) {
        _ = firstIndex(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt
    
    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2
        
        if Int(ary[mid])! < key {
            left = mid
            
        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }
    
    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}
// https://algo-logic.info/divisor/
/// 約数の配列を返す
func divisor(_ n:Int) -> [Int] {
    var ret = [Int]()
    var i = 1
    while i * i <= n {
        if n % i == 0 {
            ret.append(i)
            if i * i != n {
                ret.append(n / i)
            }
        }
        i += 1
    }
    return ret.sorted()
}

func main() {
    let input = readInts()
    let (N, X, T) = (input[0], input[1], input[2])
    //＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿ここまで入力
    
    var cnt = 1
    
    while N > X * cnt {
        cnt += 1
    }
    print(T * cnt)
}
main()
//  [typescript]
import { readFileSync } from 'fs'
import { reverse } from 'dns'
import { start } from 'repl'
 
let lines: string[] = [];
const reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
 
reader.on('line', function (line: string) {
    lines.push(line);
});
reader.on('close', function () {
    let [n, x, t] = lines[0].split(' ').map( _ => parseInt(_))
    let ans
    if(n % x == 0) {
        ans = (n / x) * t
    } else {
        ans = (Math.floor(n / x) + 1) * t
    }

    console.log(ans)
});
//  [typescript]
// A - Takoyaki
import { readFileSync } from 'fs';
const input = readFileSync('/dev/stdin', 'utf8');

const [N, X, T] = input.split(' ').map((s) => parseInt(s));

let now = N;
let time = 0;

while (now > 0) {
  now = now - X;
  time = time + T;
}

console.log(time);
//  [python]
n = int(input())
v = input().split()
for i in range(len(v)):
    v[i] = int(v[i])
nums = [[],[]]
fr = [[],[]]
for i in range(len(v)):
    idx = (i+1)%2
    if v[i] in nums[idx]:
        fr_idx = nums[idx].index(v[i])
        fr[idx][fr_idx] += 1
    else:
        nums[idx].append(v[i])
        fr[idx].append(1)
        


fr_sort = [[0,0,0,0]+sorted(fr[0]),[0,0,0,0]+sorted(fr[1])]
maxfr = [fr_sort[0][-1],fr_sort[1][-1],fr_sort[0][-2],fr_sort[1][-2]]
maxnum = [[],[],[],[]]

for i in [0,1,2,3]:
    for j in range(len(nums[i%2])):
        if fr[i%2][j] == maxfr[i]:
            maxnum[i].append(nums[i%2][j])
                   
if maxnum[0] == maxnum[1]:
    m = max([maxfr[0]+maxfr[3],maxfr[1]+maxfr[2]])
else:
    m = maxfr[0] + maxfr[1]
                   
print(n-m)
//  [python]
n = int(input())
v = list(map(int,input().split()))

v1 = []
v2 = []
for i in range(n):
    if i%2 == 0:
        v1.append(v[i])
    else:
        v2.append(v[i])
v1.sort()
v2.sort()

v1num = []
v2num = []
cnt1 = []
cnt2 = [] 
for x in v1:
    if x not in v1num:
        v1num.append(x)
        cnt1.append(1)
    else:
        cnt1[-1] += 1
for x in v2:
    if x not in v2num:
        v2num.append(x)
        cnt2.append(1)
    else:
        cnt2[-1] += 1
#print(v1num,v2num,cnt1,cnt2)

res = 0
m1 = max(cnt1)
m2 = max(cnt2)
maxc1ind = cnt1.index(m1)
maxc2ind = cnt2.index(m2)
maxc1 = v1num[maxc1ind]
maxc2 = v2num[maxc2ind]
if maxc1 != maxc2:
    res = n - m1 - m2
else:
    if len(cnt1) == 1 and len(cnt2) == 1:
        res = n // 2
    else:    
        cnt1.sort(reverse=True)
        cnt2.sort(reverse=True)
        x1 = cnt1[0] + cnt2[1]
        x2 = cnt1[1] + cnt2[0]
        res = n - max(x1,x2)
print(res)
//  [python]
import numpy as np

n = int(input())
v = np.array(list(map(int,input().split())))

# import ipdb; ipdb.set_trace()

if np.unique(v).size == 1:
    print(int(n/2))
else:
    # 偶数要素と奇数要素に分ける
    vo = v[::2]
    ve = v[1::2]
    # それぞれについて最大数の要素を見つける
    vof = np.bincount(vo).argmax()
    vef = np.bincount(ve).argmax()

    if vof == vef:
        if sum(vo == vof) > sum(ve == vef):
            vef = np.bincount(ve[ve!=vef]).argmax()
        elif sum(ve == vef) > sum(vo == vof):
            vof = np.bincount(vo[vo!=vof]).argmax()
        else :
            vof2 = np.bincount(vo[vo!=vof]).argmax()
            vef2 = np.bincount(ve[ve!=vef]).argmax()
            if (sum(vo == vof) + sum(ve == vef2)) > (sum(ve == vef) + sum(vo == vof2)):
                vef = vef2
            else:
                vof = vof2
    
    # それぞれについて最大数の数では無い要素数を数える
    vonf = sum(vo != vof)
    venf = sum(ve != vef)
    # 足しあげる
    print(vonf+venf)
//  [java]
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int[][] a = new int[100001][2];
      int[][] b = new int[100001][2];
      for(int i = 0;i < n/2;i++){
      	int x = sc.nextInt();
        int y = sc.nextInt();
        a[x][0]=x;
        b[y][0]=y;
        a[x][1]++;
        b[y][1]++;
      }
      Arrays.sort(a,Comparator.comparing((int[] x)->x[1]).reversed());
      Arrays.sort(b,Comparator.comparing((int[] x)->x[1]).reversed());
      if(a[0][0]!=b[0][0])System.out.println(n-a[0][1]-b[0][1]);
      else System.out.println(Math.min(n-a[1][1]-b[0][1],n-a[0][1]-b[1][1]));
    }
}
//  [java]
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[]v = new int[n];
		for(int i = 0; i < n; i++) {
			v[i] = scan.nextInt();
		}
		scan.close();
		Map<Integer, Integer> map1 = new HashMap<Integer, Integer>();
		Map<Integer, Integer> map2 = new HashMap<Integer, Integer>();
		for(int i = 0; i < n/2; i++) {
			map1.merge(v[2 * i], 1, (val1, val2) -> (val1 + val2));
			map2.merge(v[2 * i + 1], 1, (val1, val2) -> (val1 + val2));
		}
		if(map1.size() == 1 && map2.size() == 1) {
			if(v[0] != v[1]) {
				System.out.println(0);
			}else {
				System.out.println(n/2);
			}
			System.exit(0);
		}
		if(map1.size() == 1) {
			int kMax = -1;
			int max = 0;
			for(int k : map2.keySet()) {
				if(max < map2.get(k)) {
					kMax = k;
					max = map2.get(k);
				}
			}
			if(v[0] != kMax) {
				int ans = n/2 -  map2.get(kMax);
				System.out.println(ans);
			}else {
				int t = kMax;
				kMax = -1;
				max = 0;
				for(int k : map2.keySet()) {
					if(max < map2.get(k) && k != t) {
						kMax = k;
						max = map2.get(k);
					}
				}
				int ans = n/2 - map2.get(kMax);
				System.out.println(ans);
			}
			System.exit(0);
		}
		if(map2.size() == 1) {
			int kMax = -1;
			int max = 0;
			for(int k : map1.keySet()) {
				if(max < map1.get(k)) {
					kMax = k;
					max = map1.get(k);
				}
			}
			if(v[1] != kMax) {
				int ans = n/2 - map1.get(kMax);
				System.out.println(ans);
			}else {
				int t = kMax;
				kMax = -1;
				max = 0;
				for(int k : map1.keySet()) {
					if(max < map1.get(k) && k != t) {
						kMax = k;
						max = map1.get(k);
					}
				}
				int ans = n/2 - map1.get(kMax);
				System.out.println(ans);
			}
			System.exit(0);
		}
		int t0 = 0;
		int t1 = 0;
		int k0 = 0;
		int k1 = 0;
		int kMax = -1;
		int max = 0;
		for(int k : map1.keySet()) {
			if(max < map1.get(k)) {
				kMax = k;
				max = map1.get(k);
			}
		}
		t0 = kMax;
		kMax = -1;
		max = 0;
		for(int k : map1.keySet()) {
			if(max < map1.get(k) && k != t0) {
				kMax = k;
				max = map1.get(k);
			}
		}
		t1 = kMax;
		kMax = -1;
		max = 0;
		for(int k : map2.keySet()) {
			if(max < map2.get(k)) {
				kMax = k;
				max =  map2.get(k);
			}
		}
		k0 = kMax;
		kMax = -1;
		max = 0;
		for(int k : map2.keySet()) {
			if(max < map2.get(k) && k != k0) {
				kMax = k;
				max = map2.get(k);
			}
		}
		k1 = kMax;
		if(k0 != t0) {
			int ans = n - map1.get(t0) - map2.get(k0);
			System.out.println(ans);
			System.exit(0);
		}else {
			int m1 = n - map1.get(t0) - map2.get(k1);
			int m2 = n - map1.get(t1) - map2.get(k0);
			int ans = Math.min(m1, m2);
			System.out.println(ans);
		}
	}
}
//  [cpp]
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>

using namespace std;

bool cmp(pair<long long int, long long int> a, pair<long long int, long long int> b) {
    if(a.second!=b.second) {
        return a.second > b.second;
    } else {
        return a.first < b.first;
    }
}

int main() {
    int n;
    cin >> n;

    vector<pair<long long int, long long int> > ev;
    vector<pair<long long int, long long int> > od;
    
    for(int i=0; i<n; i++) {
        long long int v;
        cin >> v;
        if(i%2) {
            if(od.size()==0) {
                od.push_back(make_pair(v, 1));
            } else {
                bool flod=true;
                for(int j=0; j<od.size(); j++) {
                    if(od[j].first==v) {
                        od[j].second++;
                        flod=false;
                    }
                }
                if(flod) {
                    od.push_back(make_pair(v, 1));
                }
            }
        } else {
            if(ev.size()==0) {
                ev.push_back(make_pair(v, 1));
            } else {
                bool flev=true;
                for(int j=0; j<ev.size(); j++) {
                    if(ev[j].first==v) {
                        ev[j].second++;
                        flev=false;
                    }
                }
                if(flev) {
                    ev.push_back(make_pair(v, 1));
                }
            }
        }
    }
    od.push_back(make_pair(0, 0));
    ev.push_back(make_pair(0, 0));

    sort(od.begin(), od.end(), cmp);
    sort(ev.begin(), ev.end(), cmp);

    if(od[0].first!=ev[0].first) {
        cout << n - od[0].second - ev[0].second << endl;
    } else {
        if(od[0].second+ev[1].second>ev[0].second+od[1].second) {
            cout << n - od[0].second - ev[1].second << endl;
        } else {
            cout << n - od[1].second - ev[0].second << endl;
        }
    }

    return 0;
    
}
//  [cpp]
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};


int main(){
    int n; cin >> n;
    int v1,v2;
    vector<pair<int,int> > s1;
    vector<pair<int,int> > s2;
    for(int i=0;i<n;i+=2){
        cin >> v1 >> v2;
        if(i==0){
            s1.push_back(make_pair(1,v1));
            s2.push_back(make_pair(1,v2));
            continue;
        }
        bool add=true;
        for(int j=0;j<s1.size();j++){
            if(s1[j].second==v1){
                s1[j].first++;
                add=false; break;
            }
        }
        if(add) s1.push_back(make_pair(1,v1));
        add=true;
        for(int j=0;j<s2.size();j++){
            if(s2[j].second==v2){
                s2[j].first++;
                add=false; break;
            }
        }
        if(add) s2.push_back(make_pair(1,v2));
    }
    sort(s1.begin(),s1.end(),greater<pair<int,int> >());
    sort(s2.begin(),s2.end(),greater<pair<int,int> >());
    for(int i=0;i<s1.size();i++){
        cerr << s1[i].first << "," << s1[i].second << endl;
    }
    for(int i=0;i<s2.size();i++){
        cerr << s2[i].first << "," << s2[i].second << endl;
    }
    if(s1[0].second!=s2[0].second){
        cout << n-s1[0].first-s2[0].first << endl;
    }else{
        int a=n-s1[0].first-s2[1].first;
        int b=n-s1[1].first-s2[0].first;
        if(a<=b){
            cout << a << endl;
        }else{
            cout << b << endl;
        }
    }
    return 0;
}
//  [cpp]
#include "bits/stdc++.h"
#include <set>

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}
template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}

typedef pair<int, int> P;

bool pairCompare(const P& firstElof, const P& secondElof)
{
	return firstElof.second > secondElof.second;
}

signed main(void)
{
	int n;
	cin >> n;
	vector<P> odd;
	vector<P>even;

	rep(i, n) {
		int input;
		cin >> input;
		bool flag = true;
		if (i % 2 == 0) {
			rep(j, even.size()) {
				if (even[j].first == input) {
					flag = false;
					even[j].second++;
				}
			}
			if (flag) {
				even.pb(P(input, 1));
			}
		}
		else {
			rep(j, odd.size()) {
				if (odd[j].first == input) {
					flag = false;
					odd[j].second++;
				}
			}
			if (flag) {
				odd.pb(P(input, 1));
			}
		}
	}
	sort(even.begin(), even.end(), pairCompare);
	sort(odd.begin(), odd.end(), pairCompare);

	if (even[0].first == odd[0].first) {
		if (even.size() == 1 && odd.size() == 1) {
			print(n / 2);
		}
		else {
			int sub = max((even[0].second + odd[1].second), (odd[0].second + even[1].second));
			print(n - sub);
		}
	}
	else {
		print(n - odd[0].second - even[0].second);
	}
}
//  [c]
#include <stdio.h>

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

  typedef struct {
    int vn;
    int num;
  } cnt;

  cnt c1[100000 / 2];
  cnt c2[100000 / 2];
  int c1_idx = 0;
  int c2_idx = 0;
  for(int i = 0; i < n; i++)  {
    int v;
    scanf("%d", &v);

    cnt *c;
    int *idx;
    if(i % 2 == 0) {
      c = c1;
      idx = &c1_idx;
    } else {
      c = c2;
      idx = &c2_idx;
    }

    int flag = 0;
    for(int j = 0; j < *idx; j++) {
      if(c[j].vn == v) {
	c[j].num++; 
	flag = 1;
	break;
      }
    }

    if(flag == 0){
      c[*idx].vn = v;
      c[*idx].num = 1;
      *idx = *idx + 1;
    }
  }

#ifdef DEBUG  
  for(int i = 0; i < c1_idx; i++) {
    printf("c1[%d].vn == %d, num == %d\n", i, c1[i].vn, c1[i].num);
  }
  for(int i = 0; i < c2_idx; i++) {
    printf("c2[%d].vn == %d, num == %d\n", i, c2[i].vn, c2[i].num);
  }
#endif

  // Search Maximum Number
  int c1_max1 = 0;
  int c1_max2 = 0;
  int c1_idx1;
  for(int i = 0; i < c1_idx; i++) {
    if(c1[i].num >= c1_max1) {
      c1_max2 = c1_max1;
      c1_max1 = c1[i].num;
      c1_idx1 = i;
    } else if(c1[i].num > c1_max2) {
      c1_max2 = c1[i].num;
    }
  }

  int c2_max1 = 0;
  int c2_max2 = 0;
  int c2_idx1;
  for(int i = 0; i < c2_idx; i++) {
    if(c2[i].num >= c2_max1) {
      c2_max2 = c2_max1;
      c2_max1 = c2[i].num;
      c2_idx1 = i;
    } else if(c2[i].num > c2_max2) {
      c2_max2 = c2[i].num;
    }
  }

  if(c1[c1_idx1].vn == c2[c2_idx1].vn) {// same number..
    if((c1_max1 + c2_max2) < (c2_max1 + c1_max2)) {// c1 will be modified.
      c1_max1 = c1_max2;
    } else {// c2 will be modified.
      c2_max1 = c2_max2;
    }
  }

  // c1 and c2 is different number
  printf("%d\n", n - (c1_max1 + c2_max1));

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

int int_sort( const void * a , const void * b ) {
  if( *( int * )a < *( int * )b ) {
    return -1;
  }
  else
    if( *( int * )a == *( int * )b ) {
      return 0;
    }
  return 1;
}


int main(void){

  int N;
  scanf("%d", &N);

  int *A,*B;
  A = (int*)malloc((N/2)*sizeof(int));
  B = (int*)malloc((N/2)*sizeof(int));
  for(int i=0; i<N; i++){
    scanf("%d %d ", &A[i], &B[i]);
  }

  qsort(A,N/2,sizeof(int),int_sort);
  qsort(B,N/2,sizeof(int),int_sort);
  int num=1,maxA1=0,maxA2=0,keyA1=0,keyA2=0,maxB1=0,maxB2=0,keyB1=0,keyB2=0;

  for(int i=0; i<N/2-1; i++){
    if(A[i]==A[i+1]){
      num++;
    }else{
      if(num>maxA1){
        maxA2 = maxA1;
        maxA1 = num;
        keyA2 = keyA1;
        keyA1 = A[i];
      }else if(num>maxA2){
        maxA2 = num;
        keyA2 = A[i];
      }
      num = 1;
    }
  }
  if(num>maxA1){
    maxA2 = maxA1;
    maxA1 = num;
    keyA2 = keyA1;
    keyA1 = A[N/2-1];
  }else if(num>maxA2){
    maxA2 = num;
    keyA2 = A[N/2-1];
  }
  num=1;

  for(int i=0; i<N/2-1; i++){
    if(B[i]==B[i+1]){
      num++;
    }else{
      if(num>maxB1){
        maxB2 = maxB1;
        maxB1 = num;
        keyB2 = keyB1;
        keyB1 = B[i];
      }else if(num>maxB2){
        maxB2 = num;
        keyB2 = B[i];
      }
      num = 1;
    }
  }
  if(num>maxB1){
    maxB2 = maxB1;
    maxB1 = num;
    keyB2 = keyB1;
    keyB1 = B[N/2-1];
  }else if(num>maxB2){
    maxB2 = num;
    keyB2 = B[N/2-1];
  }

  int ans=0;

  if(keyA1!=keyB1){
    ans = N-maxA1-maxB1;
  }else if(maxA2>maxB2){
    ans = N-maxA2-maxB1;
  }else{
    ans = N-maxA1-maxB2;
  }

  printf("%d\n", ans);

  return 0;
}
//  [javascript]
function main(input) {
  var args = input.split('\n');
  var n = parseInt(args[0]);
  var an = args[1].split(' ');
  var on = [];
  var en = [];
  for(var i = 0; i < n; i++){
    if(i % 2 == 0) en.push(parseInt(an[i]));
    else on.push(parseInt(an[i]));
  }
  en.sort();
  on.sort();

  //最頻値と次の値を求める
  //出力を(x,n) (x2,n2)とする
  Array.prototype.mode2 = function () {
    var arr = [];
    var prevValue;
    this.forEach(function(element,index){
      if(element != prevValue){
        arr.unshift([element,1]);
        prevValue = element;
      }else{
        arr[0][1] += 1;
      }
    })
    
    arr.sort(function(a,b){
      return b[1] - a[1];
    })

    if(!arr[1]){
      arr.push([null,0]);
    }
    return [[arr[0][0],arr[0][1]],[arr[1][0],arr[1][1]]];
  }
  var evModes = en.mode2();
  var odModes = on.mode2();
  var ans = 0;

  if(evModes[0][0] != odModes[0][0]){
    ans = n - (evModes[0][1] + odModes[0][1]);
  }else{
    ans = n - Math.max(evModes[1][1] + odModes[0][1], evModes[0][1] + odModes[1][1]);
  }
  console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
// 解説をそのまま写経した感じです

function Main(input){
  input = input.split("\n");
  var n = ~~input[0]
  var v = input[1].split(" ");
  var even = [];
  var odd = [];
  for(var i = 0; i < n; i++){
  	var h = v[i];
    var a = (i%2?odd:even)[h];
    a = a || {val:h,count:0};
    a.count++;
    if(i%2){odd[h]=a}else{even[h]=a};
  }
  even = even.sort((a,b)=>a.count-b.count).reverse().filter(a=>a);
  odd = odd.sort((a,b)=>a.count-b.count).reverse().filter(a=>a);
  // filter : nullを消去
 
  if(even[0].val!=odd[0].val){
  	return n - even[0].count - odd[0].count;
    // 最頻値が異なる
  }
  if(!even[1] && !even[2]){
  	return n/2;
    // 偶奇どちらの副最頻値も存在しない
    // （すべての数字が同じ）
  }
  if(!even[1]){
  	return n - even[0].count - odd[1].count;
    // 偶数番目の副最頻値が存在しない
  }
  if(!odd[1]){
  	return n - even[1].count - odd[0].count;
    // 奇数番目の副最頻値が存在しない
  }
  return Math.min(
  	n - even[0].count - odd[1].count,
    n - even[1].count - odd[0].count
  );
}

console.log(Main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [javascript]
// 解説をそのまま写経した感じです

function Main(input){
  input = input.split("\n");
  var n = ~~input[0]
  var v = input[1].split(" ");
  var even = [];
  var odd = [];
  for(var i = 0; i < n; i++){
  	var h = v[i];
    var a = (i%2?odd:even)[h];
    a = a || {val:h,count:0};
    a.count++;
    if(i%2){odd[h]=a}else{even[h]=a};
  }
  even = even.sort((a,b)=>a.count-b.count).reverse().filter(a=>a);
  odd = odd.sort((a,b)=>a.count-b.count).reverse().filter(a=>a);
  // filter : nullを消去
 
  if(even[0].val!=odd[0].val){
  	return n - even[0].count - odd[0].count;
    // 最頻値が異なる
  }
  if(!even[1] && !even[2]){
  	return n/2;
    // 偶奇どちらの副最頻値も存在しない
    // （すべての数字が同じ）
  }
  if(!even[1]){
  	return n - even[0].count - odd[1].count;
    // 偶数番目の副最頻値が存在しない
  }
  if(!odd[1]){
  	return n - even[1].count - odd[0].count;
    // 奇数番目の副最頻値が存在しない
  }
  return Math.min(
  	n - even[0].count - odd[1].count,
    n - even[1].count - odd[0].count
  );
}

if(typeof require !== 'undefined')console.log(Main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	vs := make([]int, n)
	for i := range vs {
		fmt.Scan(&vs[i])
	}

	even := map[int]int{}
	odd := map[int]int{}
	for i, v := range vs {
		if i%2 == 0 {
			even[v]++
		} else {
			odd[v]++
		}
	}

	ek1, ev1 := mapMax(even)
	ok1, ov1 := mapMax(odd)
	if ek1 != ok1 {
		fmt.Println(n - ev1 - ov1)
		return
	}

	delete(odd, ok1)
	delete(even, ek1)
	_, ov2 := mapMax(odd)
	_, ev2 := mapMax(even)
	if ev1 == ov1 {
		fmt.Println(n - ev1 - max(ov2, ev2))
	} else if ev1 > ov1 {
		fmt.Println(n - ev1 - ov2)
	} else {
		fmt.Println(n - ov1 - ev2)
	}
}

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

func mapMax(m map[int]int) (mk int, mv int) {
	for k, v := range m {
		if v > mv {
			mv = v
			mk = k
		}
	}
	return
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	vs := make([]int, n)
	for i := range vs {
		fmt.Scan(&vs[i])
	}

	even := map[int]int{}
	odd := map[int]int{}
	for i, v := range vs {
		if i%2 == 0 {
			even[v]++
		} else {
			odd[v]++
		}
	}

	ek1, ev1 := mapMax(even)
	ok1, ov1 := mapMax(odd)
	if ek1 != ok1 {
		fmt.Println(n - ev1 - ov1)
		return
	}

	delete(odd, ok1)
	delete(even, ek1)
	_, ov2 := mapMax(odd)
	_, ev2 := mapMax(even)
	fmt.Println(min(n-ev1-ov2, n-ov1-ev2))
}

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

func mapMax(m map[int]int) (mk int, mv int) {
	for k, v := range m {
		if v > mv {
			mv = v
			mk = k
		}
	}
	return
}
//  [go]
// 偶奇で数えて登場回数最大以外を書き換えるんじゃないの
// 書き換える先が偶奇で同じになってしまったら二番目に大きいやつで勝負してぶつける
// コーナーケース注意（二番目が存在しない）
// 実装がクソ
package main

import (
	"fmt"
	"sort"
)

type KV struct {
	k, v int
}

type KVS []KV

func (kvs KVS) Len() int {
	return len(kvs)
}

func (kvs KVS) Less(i, j int) bool {
	return kvs[i].v > kvs[j].v
}

func (kvs KVS) Swap(i, j int) {
	kvs[i], kvs[j] = kvs[j], kvs[i]
}

func main() {
	var N int
	fmt.Scan(&N)
	evenMap, oddMap := make(map[int]int), make(map[int]int)
	for i := 0; i < N; i++ {
		var V int
		fmt.Scan(&V)
		if i%2 == 0 {
			oddMap[V]++
		} else {
			evenMap[V]++
		}
	}
	var evenKVSS, oddKVSS KVS
	for k, v := range evenMap {
		evenKVSS = append(evenKVSS, KV{k: k, v: v})
	}
	for k, v := range oddMap {
		oddKVSS = append(oddKVSS, KV{k: k, v: v})
	}
	sort.Sort(evenKVSS)
	sort.Sort(oddKVSS)
	if len(evenKVSS) == 1 && len(oddKVSS) == 1 {
		if evenKVSS[0].k == oddKVSS[0].k {
			// 登場する数が全て同じなのでどっちかをまるっと変更する
			fmt.Println(N / 2)
		} else {
			// そのまんまでいい
			fmt.Println(0)
		}
	} else if len(evenKVSS) == 1 || len(oddKVSS) == 1 {
		// 2つ以上あるやつを変更したいがこれもkで決まるな...めんどくせ
		if evenKVSS[0].k == oddKVSS[0].k {
			if len(evenKVSS) == 1 {
				fmt.Println(N/2 - oddKVSS[1].v)
			} else {
				fmt.Println(N/2 - evenKVSS[1].v)
			}
		} else {
			if len(evenKVSS) == 1 {
				fmt.Println(N/2 - oddKVSS[0].v)
			} else {
				fmt.Println(N/2 - evenKVSS[0].v)
			}
		}
	} else {
		if evenKVSS[0].k == oddKVSS[0].k {
			// 数が被るので少ないほうをまるっと変更する
			if evenKVSS[0].v == oddKVSS[0].v {
				// しょうがないので二番目に大きい方で比較する
				if evenKVSS[1].k == oddKVSS[1].k {
					// どっちかを最大、他方を二番目のやつを採用する
					fmt.Println(N/2 - evenKVSS[0].v + N/2 - oddKVSS[1].v)
				} else {
					// 二番目のやつの登場回数が多い方を採用する
					if evenKVSS[1].v > oddKVSS[1].v {
						fmt.Println(N/2 - evenKVSS[1].v + N/2 - oddKVSS[0].v)
					} else if evenKVSS[1].v < oddKVSS[1].v {
						fmt.Println(N/2 - evenKVSS[0].v + N/2 - oddKVSS[1].v)
					} else {
						// なんだこれ
						// どっちかを最大、他方を二番目におおきいやつ
						fmt.Println(N/2 - evenKVSS[0].v + N/2 - oddKVSS[1].v)
					}
				}
			} else {
				// 登場回数の少ない方は二番目のやつを採用
				if evenKVSS[0].v > oddKVSS[0].v {
					fmt.Println(N/2 - evenKVSS[0].v + N/2 - oddKVSS[1].v)
				} else {
					fmt.Println(N/2 - evenKVSS[1].v + N/2 - oddKVSS[0].v)
				}
			}
		} else {
			// どちらも最大のやつはかぶらないのでどちらもそれ以外のやつを最大のやつに合わせる
			fmt.Println(N/2 - evenKVSS[0].v + N/2 - oddKVSS[0].v)
		}
	}
}

// 8
// 2 5 2 9 1 5 3 5
//  [ruby]
N = gets.to_i
V = gets.split.map(&:to_i)

ls = V.partition.with_index {|v,i| i.even? }
a,b = ls.map.with_index {|v,i| v.group_by(&:itself).map {|k,v| [v.size, k] }.sort }

if a[-1][1] != b[-1][1]
  ans = N - a[-1][0] - b[-1][0]
elsif a[-2] == nil && b[-2] == nil
  ans = N - [a[-1][0], b[-1][0]].max
else
  ans = N - [a[-1][0] + (b[-2][0]||0), a[-2][0] + (b[-1][0]||0)].max
end
puts ans