jiahuimbzuai/CoQuIR huggingface dataset:
//  [go]
package main

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

func rotN(n int, s string) string {
  rs := []rune(s)
  for i, r := range rs {
    r = ((r - 'A' + rune(n)) % 26) + 'A'
    rs[i] = r
  }
  return string(rs)
}

func main() {
  buf := bufio.NewReaderSize(os.Stdin, 1024*1024)
  nTemp := readLine(buf)
  n, err := strconv.ParseInt(nTemp, 10, 64)
  checkErr(err)
  s := readLine(buf)
  fmt.Fprintf(os.Stdout, "%v\n", rotN(int(n), s))
}

func readLine(reader *bufio.Reader) string {
  str, _, err := reader.ReadLine()
  if err == io.EOF {
    return ""
  }
  return strings.TrimRight(string(str), "\n\r")
}

func checkErr(err error) {
  if err != nil {
    panic(err)
  }
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var N int
	var S string
	fmt.Scan(&N, &S)
	for i := 0; i < len(S); i++ {
		sub := []rune(S)
		changed := sub[i] + rune(N) - rune(0)
		if changed > 'Z' {
			changed = changed - 'Z' + 'A' - rune(1) + rune(0)
		}
		fmt.Printf("%c", changed)
	}
	fmt.Println()
}
//  [go]
package main

import (
	"fmt"
)

func main() {

	var N int
	var S string
	fmt.Scanf("%d", &N)
	fmt.Scanf("%s", &S)

	for i := 0; i < len(S); i++ {
		if int(S[i])+N <= int('Z') {
			fmt.Printf("%s", string(int(S[i])+N))
		} else {
			fmt.Printf("%s", string(int(S[i])+N-26))
		}
	}
	fmt.Printf("\n")
}
//  [go]
package main

import "fmt"

func main() {
	var str string
	var n int32
	fmt.Scan(&n)
	fmt.Scan(&str)

	for _, s := range str{
		x := s - 'A'
		x = (x+n)%26
		fmt.Print(string('A'+x))
	}
	fmt.Println("")
}
//  [ruby]
n=gets.to_i
s=gets.chomp
n.times do |i|
  s=s.tr('A-Z','B-ZA')
end
puts s
//  [ruby]
# frozen_string_literal: true

n = gets.to_i
s = gets.chomp

n.times do
  s.tr!('A-Z', 'B-ZA')
end

print s
//  [ruby]
N = gets.chop.to_i
S = gets.chop

a = [*"A".."Z"]
puts S.tr(a.join, a.rotate(N).join)
//  [ruby]
n = gets.to_i
s = gets.chomp

s.length.times do |i|
  if n > 0
    n.times do
      if s[i] == "z"
        s[i] = "a"
      elsif s[i] == "Z"
        s[i] = "A"
      else
        s[i] = s[i].succ
      end
    end
  end
end

puts s
//  [ruby]
n = gets.to_i
s = gets.chomp

len = s.length
for i in 0..len-1
  n.times do
    if s[i] == "Z"
      s[i] = "A"
    else
      s[i] = s[i].succ
    end
  end
end

puts s
//  [ruby]
N = gets.chomp.to_i
S = gets.chomp

(0..(S.length - 1)).each do |i|
  (0..(N-1)).each do |j|
    S[i] = S[i].succ[0]
  end
end
puts S
//  [rust]
use std::io::*;
use std::str::FromStr;
use std::collections::LinkedList;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[derive(Clone, Debug)]
struct Query {
    a: usize,
    b: usize,
}

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

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

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

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

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

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

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

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

    input!{
        n: u32,
        s: chars,
    }

    let mut ans: String = String::new();
    // for i in s{
    //     if i=='Z'{
    //         ans += &'Z'.to_string();
    //     } else {
    //         let mut c = char::from_u32(i as u32 + n);
    //         ans += &c.to_string();
    //     }
    // }

    ans = s.iter().map( |&x| {
        std::char::from_u32('A' as u32 + (x as u32 - 'A' as u32 + n) % 26).unwrap()
    }).collect();

    println!("{}", ans);

}
//  [rust]
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

#[allow(dead_code)]
struct Scanner<'a> {
    cin: StdinLock<'a>,
}
#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn input<T: FromStr>(&mut self) -> T {
        self.read().unwrap()
    }

    fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.input()).collect()
    }

    fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let n: u8 = sc.input();
    let ans: String = sc.input::<String>().chars()
        .map(|ch: char| ((ch as u8 - 'A' as u8 + n) % 26 + 'A' as u8) as char).collect();
    println!("{}", ans)
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: u8,
        s: String,
    }

    let s = s.as_bytes().to_vec();
    let mut ans = vec![];

    for c in s {
        let c = c - b'A';
        let c = (c + n) % 26;
        let c = c + b'A';
        ans.push(c);
    }

    dbg!(&ans);
    println!("{}", std::str::from_utf8(&ans).unwrap());
}
//  [rust]
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: u8 = read();
    let s: String = read();

    for i in 0..s.len() {
        print!("{}", ((s.chars().nth(i).unwrap() as u8 + n) % 65 % 26 + 65) as char);
    }
}
//  [swift]
let n=Int(readLine()!)!
let s=readLine()!

var ans = [Character]()

for c in s.unicodeScalars {
  if c.value >= 65 && c.value <= 90 {
    var x = Int(c.value) + n
    if x >= 91 {
      x = x - 91 + 65
    }
    let a = Character(UnicodeScalar(x))
    ans += [a]
  }
}

print(String(ans))
//  [swift]
let a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".characters.map{$0}
let N = Int(readLine()!)!
print(String(readLine()!.characters.map{a[(a.indexOf($0)!+N)%26]}))
//  [typescript]
import * as fs from "fs";

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

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

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

const n: number = +input[0];
const s: string[] = input[1].split('');

let ans: string = '';
const len = s.length;

for(let i = 0; i < len; i++){
    const id: number = s[i].charCodeAt(0) + n;
    let id2: number;
    if (id >= 91){
        id2 = id%91 + 65;
    }else{
        id2 = id;
    }
    const tmp = String.fromCharCode(id2);
    ans += tmp;
}
console.log(ans);
//  [typescript]
// @flow

const main = (input /*: string */) => {
  const r = reader(input)
  const n = r.n()
  const s = r.s()

  console.log(_rot(s, n))
}

const _rot = (s /* :string */, n /*: number */) =>
  s
    .split('')
    .map(c => _shift(c, n))
    .join('')

const _shift = (c /*: string */, n /*: number */) => {
  const ac = 'A'.charCodeAt(0)

  return String.fromCharCode(((c.charCodeAt(0) + n - ac) % 26) + ac)
}

const reader = (str /*: string*/) => {
  const lines = str.trim().split('\n')
  const s = () => lines.shift() || ''
  const n = () => Number(s())

  const ss = () => s().split(' ')
  const ns = () => ss().map(v => Number(v))

  return { lines, s, n, ss, ns }
}

const getInput = () => require('fs').readFileSync('/dev/stdin', 'utf8')

main(getInput())
//  [typescript]
export const Main = function (input: Array<Array<string>>) {
  const N = parseInt(input[0][0]);
  const S = input[1][0]
  const Z = 'Z'.charCodeAt(0);
  let ans = ''
  for (let i = 0; i < S.length; i++) {
    let charcode = S.charCodeAt(i);
    charcode += N;
    if (charcode > Z) {
      charcode -= 26
    }
    ans += String.fromCharCode(charcode);
  }
  console.log(ans)
}
const parseInput = (input: string) => {
  const lines = input.split("\n");
  if (lines[lines.length - 1] === "") lines.pop();
  return lines.map((el) => (el.split(" ")));
}

Main(parseInput(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let n=nin()
  let s=sin()
  for(let k=0;k<n;k++){
    let t='';
    for(let i=0;i<s.length;i++){
      t+=sw(s[i],[
        'A','B',
        'B','C',
        'C','D',
        'D','E',
        'E','F',
        'F','G',
        'G','H',
        'H','I',
        'I','J',
        'J','K',
        'K','L',
        'L','M',
        'M','N',
        'N','O',
        'O','P',
        'P','Q',
        'Q','R',
        'R','S',
        'S','T',
        'T','U',
        'U','V',
        'V','W',
        'W','X',
        'X','Y',
        'Y','Z',
        'Z','A'
      ]);
    }
    s = t;
  }
  out(s);
}
main()
//  [typescript]
let n = -1;
let str;
var reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on("line", function(line) {
  if (n === -1) {
    n = Number(line);
  } else {
    str = line as string;
    console.log(rot13(str,n));
    process.exit(0)
  }
});
function rot13(str:string,n:number) {
    let newstr = "";
    for (let i = 0; i < str.length; i++) {
      const code = str[i].charCodeAt(0);
      if ("Z".charCodeAt(0) >= code && "A".charCodeAt(0) <= code) {
        newstr += String.fromCodePoint(
          ((code - "A".charCodeAt(0) + n) % 26) + "A".charCodeAt(0)
        );
      } else if ("z".charCodeAt(0) >= code && "a".charCodeAt(0) <= code) {
        newstr += String.fromCodePoint(
          ((code - "a".charCodeAt(0) + n) % 26) + "a".charCodeAt(0)
        );
      } else {
        newstr += str[i];
      }
    }
    return newstr;
  }
//  [typescript]
function Main(input) {
  const splited = input.split('\n');
  const ans = splited[1].split('').map(x => {
    const next = x.charCodeAt() + parseInt(splited[0], 10);
    if(next === 90) {
      return 'Z' 
    }
    if(next > 90) {
      return String.fromCharCode(next - 90 + 64)
    } else {
      return String.fromCharCode(next)
    }
  }).join('')
  console.log(ans)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
def inpl(): return [int(i) for i in input().split()]

N = int(input())
A, B = inpl()
P = inpl()

ctr1, ctr2, ctr3 = 0, 0, 0

for i in P:
    if i <= A:
        ctr1 += 1
    elif i <= B:
        ctr2 += 1
    else:
        ctr3 += 1
print(min(ctr1, ctr2, ctr3))
//  [python]
#!/usr/bin/env python3


def solve(a, b, ps):
    easy = mid = hard = 0
    for p in ps:
        if p <= a:
            easy += 1
        elif a + 1 <= p <= b:
            mid += 1
        else:
            hard += 1
    return min(easy, mid, hard)


def main():
    _ = int(input())
    a, b = (int(z) for z in input().split())
    ps = [int(z) for z in input().split()]
    res = solve(a, b, ps)
    print(res)


if __name__ == "__main__":
    main()
//  [python]
n = int(input())
a, b = [int(_) for _ in input().split()]
p = [int(_) for _ in input().split()]

first = 0
second = 0
third = 0
for pi in p:
    if pi <= a:
        first += 1
    elif pi <= b:
        second += 1
    else:
        third += 1

print(min(first, second, third))
//  [python]
#!/Users/takahiro.kida/git/atcorder/venv/bin/python

import numpy
import scipy

N = int(input())
A,B = [int(x) for x in input().split(" ")]
P = [int(x) for x in input().split(" ")]

cnt = [0,0,0]
for p in P:
    if p <= A:
        cnt[0] += 1
    elif p <= B:
        cnt[1] += 1
    else:
        cnt[2] += 1

print(min(cnt))
//  [python]
import numpy as np

n = int(input())
a,b = list(map(int, input().split()))
p = list(map(int, input().split()))
p = np.array(p)
try:
    print(np.min([np.sum(p <= a), np.sum((a < p) * (p <= b)), np.sum((b < p))]))
except:
    print(0)
//  [python]
import numpy as np

N = int(input())
A,B = [int(i) for i in input().split()]
P = [int(i) for i in input().split()]

low = len([i for i in P if i <= A])
mid = len([i for i in P if (i > A and i <= B)])
high = len([i for i in P if i > B])

num = min(low,mid,high)

print(num)
//  [java]
import java.io.*;
import java.util.*;
import java.util.Map.Entry;

public class Main {
		
	public static void main(String[] args) throws IOException {
		FastScanner sc = new FastScanner(System.in);
		
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int[] P = new int[N];
		int[] num = new int[3];
		for(int i = 0; i < N; i++){
			P[i] = sc.nextInt();
			if(P[i] <= A) num[0]++;
			if(P[i] > A && P[i] <= B) num[1]++;
			if(P[i] > B) num[2]++;
		}
		
		int ans = Math.min(num[0], Math.min(num[1], num[2]));
		System.out.println(ans);
		
		
	}//end main
	
}//end Main

class FastScanner {
    private InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    public FastScanner(InputStream in) {
		this.in = in;
	}
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
    	if (hasNextByte()) return buffer[ptr++];
    	else return -1;
    }
    private static boolean isPrintableChar(int c){
    	return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
    	while(hasNextByte() && !isPrintableChar(buffer[ptr]))
    		ptr++; return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
}
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String args[]) {
		FastScanner scanner = new FastScanner();
		int n = scanner.nextInt();
		int a=scanner.nextInt();
		int b=scanner.nextInt();
		int[] p=new int[n];
		int f=0;
		int s=0;
		int t=0;
		for(int i=0;i<n;i++) {
			p[i]=scanner.nextInt();
			if(p[i]<=a) {
				f++;
			}else if(p[i]<=b) {
				s++;
			}else {
				t++;
			}
		}
		int min=Math.min(f, s);
		min=Math.min(min, t);
		System.out.println(min);
	}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}
//  [java]
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int[] num = new int[3];
        for(int i=0; i<n; i++){
            int p = sc.nextInt();
            if(p <= a){
                num[0]++;
            }else if(p <= b){
                num[1]++;
            }else{
                num[2]++;
            }
        }

        System.out.println(Arrays.stream(num).min().getAsInt()
        );
    }
}
//  [java]
import java.util.*;
import java.util.stream.Collectors;
public class Main {
	
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        List<Integer> list = new ArrayList<>(N);
        for (int i = 0; i < N; i++) {
        	list.add(sc.nextInt());
        }
        
        list = list.stream().sorted().collect(Collectors.toList());
        
        int ans = 0;
        for (int i = 0; i < list.size(); i++) {
        	for (int j = i+1; j < list.size(); j++) {
        		for (int k = j+1; k < list.size(); k++) {
        			int a = list.get(i);
        			int b = list.get(j);
        			int c = list.get(k);
        			
        			if (a == 0 || b == 0 || c == 0) {
        				continue;
        			}
        			
        			if (a <= A && A+1 <= b && b <= B && B+1 <= c) {
        				list.set(i, 0);
        				list.set(j, 0);
        				list.set(k, 0);
        				ans++;
        			}
        		}
        	}
        }
        
        System.out.println(ans);
    }
}
//  [cpp]
#include<cstdio>
#include<algorithm>
using namespace std;

#define MAXN 100
int N;
int P[MAXN+5];

int main(){
    int N,A,B;
    scanf("%d",&N);
    scanf("%d%d",&A,&B);
    for(int i=1;i<=N;i++)
        scanf("%d",P+i);
    int cnt1=0,cnt2=0,cnt3=0;
    for(int i=1;i<=N;i++){
        if(P[i]<=A)
            cnt1++;
        else if(P[i]<=B)
            cnt2++;
        else
            cnt3++;
    }
    printf("%d",min(cnt1,min(cnt2,cnt3)));
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  vector<int> p;
  cin >> n >> a >> b;
  p.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
  }
  sort(p.begin(), p.end());
  int i = 0;
  int num[3];
  for (; i < n and p[i] <= a; ++i) ;
  num[0] = i;
  int oi = i;
  for (; i < n and p[i] <= b; ++i);
  num[1] = i - oi;
  num[2] = n - i;
  cout << min({num[0], num[1], num[2]});
}
//  [cpp]
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator>  // std::back_inserter()
#include <set>
#include <map>
#include <algorithm>  // std::copy()
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <bitset>  // static_cast<std::bitset<8>>
#include <sstream>  // std::stringstream
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
#include <iomanip>  // std::setprecision()
using namespace std;

#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define REPN(i, n) for (int i=1; i <= (int)(n); i++)  // 1 ~ n
#define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(ALL((vec)))
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(ALL((vec)), 0)  // 0 は初期値
#define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
typedef long long ll;

const int MOD = 1000000007;  // 1 000 000 007


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    // input
    int N, A, B;
    cin >> N >> A >> B;
    vector<int> vec(N);
    REP(i, N) cin >> vec[i];
    
    // calculation
    sort(vec.begin(), vec.end());
    int max_num = N/3, low = 0, middle = 0, up = 0;
    REP(i, N) {
        if (vec[i] <= A) {
            low++;
        } else if (A+1 <= vec[i] && vec[i] <= B){
            middle++;
        } else if (B+1 <= vec[i]) {
            up++;
        }
    }
    
    if (low == 0 || middle == 0 || up == 0) {
        cout << 0 << "\n";
    } else {
        cout << min(low, min(middle, up)) << "\n";
    }
    
    return 0;
}
//  [cpp]
#include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define ll  long long 
#define rep(i, n)        for(ll i=0; i<(ll)(n); ++i)
#define mod 1000000007
  vector<ll>to[1000005];
int main(){
  ll a,b,c=0,d=0,e=0,f,g;cin>>a>>f>>g;
  rep(i,a){
    cin>>b;
    if(b<=f)c++;
    else if(b<=g)e++;
    else d++;
  }
  cout<<min({c,d,e});
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int min(int a,int b,int c){
    int asdf=a;
    if(asdf>b){asdf=b;}
    if(asdf>c){asdf=c;}
    return asdf;
}



int main(void){
int n,a,b,p[105];
int one=0,two=0,three=0;
scanf("%d",&n);
scanf("%d %d",&a,&b);

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

for(int i=0;i<n;i++){
if(p[i]<=a){one++;}
else if(a+1<=p[i]&&p[i]<=b){two++;}
else {three++;}
}

printf("%d",min(one,two,three));
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
#define rep(i,n)Rep(i,0,n)
typedef long long ll;
typedef long double ld;

int main() {
	int n, a, b, p,j=0,k=0,l=0,min;
	scanf("%d\n%d %d", &n, &a,&b);
	rep(i, n) {
		scanf("%d", &p);
		if (p <= a)j++;
		else if (p <= b)k++;
		else l++;
	}
	min = j;
	if (min > k)min = k;
	if (min > l)min = l;
	printf("%d\n", min);
}
//  [c]
#include <stdio.h>

int main(void) {

  int n,a,b;
  scanf("%d %d %d", &n, &a, &b);
  int p[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i]);
  }
  int under_a = 0;
  int under_b = 0;
  int contest;
  for (int i = 0; i < n; i++) {
    if (p[i] <= a) {
      under_a++;
    } else if (p[i] <= b) {
      under_b++;
    }
  }
  contest = under_a;
  if (contest > under_b) {
    contest = under_b;
  }
  if (contest > n-under_a-under_b) {
    contest = n-under_a-under_b;
  }
  printf("%d\n", contest);

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

int main(){
    int N, A, B, P[101], i;
    scanf("%d", &N);
    scanf("%d %d", &A, &B);
    for (i = 0; i < N; i++){
        scanf("%d", &P[i]);
    }

    int a=0, b=0, c=0;
    for (i = 0; i < N; i++){
        if(P[i] <= A){
            a += 1;
        }
        else if(P[i] >= B+1){
            c += 1;
        }
        else{
            b += 1;
        }
    }

    int d;
    if (a <= b){
        d = a;
    }
    else{
        d = b;
    }
    if (d >= c){
        d = c;
    }
    printf("%d\n", d);
    return 0;
}
//  [c]
#include <stdio.h>

int N;
int A, B;
int P[128];

int main(void) {
	int i;
	int asumi = 0, iguti = 0, ogura = 0, hikasa;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%d%d", &A, &B) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &P[i]) != 1) return 1;
	}

	for (i = 0; i < N; i++) {
		if (P[i] <= A) asumi++;
		else if (P[i] <= B) iguti++;
		else ogura++;
	}

	hikasa = asumi;
	if (hikasa > iguti) hikasa = iguti;
	if (hikasa > ogura) hikasa = ogura;
	printf("%d\n", hikasa);

	return 0;
}
//  [javascript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let N = Number(xs[0]);
   let A = Number(xs[1].split(" ")[0]);
   let B = Number(xs[1].split(" ")[1]);
   let P1 = [];
   let P2 = [];
   let P3 = [];
   let P = xs[2].split(' ').map(v=>parseInt(v,10));
   
   for(let i=0; i<N; i++){
     if(P[i]<=A){
       P1.push(P[i]);
     }else if(P[i]<=B){
       P2.push(P[i]);
     }else{
       P3.push(P[i])
     }
   }
   let ans =Math.min(P1.length,P2.length,P3.length);
   console.log(ans)
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
function Main(input){
	input = input.split("\n");
	var mem = input[1].split(" ").map(Number)
	var a = mem[0];
	var b = mem[1];
	var sum = [0,0,0];
	var arr = input[2].split(" ").map(Number);
	for(var i=0;i<arr.length;i++){
		if(arr[i]<=a){
			sum[0]++;
		}else if(arr[i]<=b){
			sum[1]++;
		}else{
			sum[2]++;
		}
	}
			console.log(Math.min.apply(null,sum));
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}
function Main(input) {
  input = myconv(input,3);
  var N = myconv(input[0],1);
  var A = myconv(input[1],4)[0];
  var B = myconv(input[1],4)[1];
  var list = myconv(input[2],4);
  var output = [0,0,0];
  for(var i = 0; i < N; i++){
    if(list[i] <= A){
       output[0]++;
    }else if(list[i] > A && list[i] <= B){
       output[1]++;      
	}else if(list[i] > B){
       output[2]++;      
	}
  }
  myout(Math.min.apply(null,output));
}
Main(myin());
//  [javascript]
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));

console.log(main());
function main(){
  var n = o.a();
  var a = o.a();
  var b = o.a();
  var p = o.l();
  var x = 0, y = 0;
  for(var i = 0; i < n; i++){
    if(p[i] <= a)x++;
    else if(p[i] > b)y++;
  }
  return Math.min(x,y,n-x-y);
}
//  [javascript]
"use strict";

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }

function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

function main(input) {
  var lines = input.split('\n');
  var N = parseInt(lines[0]);

  var _splitNum = splitNum(lines[1]),
      _splitNum2 = _slicedToArray(_splitNum, 2),
      A = _splitNum2[0],
      B = _splitNum2[1];

  var ps = splitNum(lines[2]).slice(0, N);
  var ac = 0,
      bc = 0,
      cc = 0;
  var _iteratorNormalCompletion = true;
  var _didIteratorError = false;
  var _iteratorError = undefined;

  try {
    for (var _iterator = ps[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
      var p = _step.value;

      if (p <= A) {
        ac++;
      } else if (p <= B) {
        bc++;
      } else {
        cc++;
      }
    }
  } catch (err) {
    _didIteratorError = true;
    _iteratorError = err;
  } finally {
    try {
      if (!_iteratorNormalCompletion && _iterator.return != null) {
        _iterator.return();
      }
    } finally {
      if (_didIteratorError) {
        throw _iteratorError;
      }
    }
  }

  console.log(Math.min(ac, bc, cc));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

function splitNum(line) {
  return line.split(/\s+/).map(function (n) {
    return parseInt(n);
  });
}
//  [javascript]
function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  var A = parseInt(input[1].split(" ")[0]);
  var B = parseInt(input[1].split(" ")[1]);
  P1 = new Array();
  P2 = new Array();
  P3 = new Array();
  tmp= input[2].split(" ");
  for(var i=0;i<N;i++){
    P=parseInt(tmp[i]);
    if(P<=A){
      P1.push(P);
    }else if(P<=B){
      P2.push(P);
    }else{
      P3.push(P);
    }
  }
  var ans = Math.min(P1.length,P2.length,P3.length);

  console.log('%s', ans);
}
  
// "実行する"ボタンを押した時に実行される関数 (デバッグ用)
function debug(){
  var input = document.getElementById("input").value;
  Main(input);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 2
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	a := getNextInt(scanner)
	b := getNextInt(scanner)
	m := make([]int, 3)
	for i := 0; i < n; i++ {
		m[score(a, b, getNextInt(scanner))]++
	}
	ans := n
	for i := 0; i < 3; i++ {
		if ans > m[i] {
			ans = m[i]
		}
	}
	fmt.Fprintln(writer, ans)
}

func score(a, b, p int) int {
	if p <= a {
		return 0
	}
	if p <= b {
		return 1
	}
	return 2
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

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

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

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

func min(nums []int) int {
	ret := nums[0]
	for _, v := range nums {
		if v < ret {
			ret = v
		}
	}
	return ret
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	a, b := nextInt(), nextInt()
	cnt := make([]int, 3)
	for i := 0; i < n; i++ {
		p := nextInt()
		if p <= a {
			cnt[0]++
		} else if p <= b {
			cnt[1]++
		} else {
			cnt[2]++
		}
	}
	fmt.Println(min(cnt))
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	sc.Scan()
	iv, _ := strconv.Atoi(sc.Text())
	return iv
}

func init() {
	sc.Split(bufio.ScanWords)
}

func mins(x ...int) int {
	mv := x[0]
	for _, v := range x[1:] {
		if v < mv {
			mv = v
		}
	}
	return mv
}

func main() {
	n, a, b := scanInt(), scanInt(), scanInt()
	ca, cb, cc := 0, 0, 0
	for i := 0; i < n; i++ {
		p := scanInt()
		if p <= a {
			ca++
		} else if p >= b+1 {
			cc++
		} else {
			cb++
		}
	}
	fmt.Println(mins(ca, cb, cc))
}
//  [go]
package main

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

func main() {
	N, A, B := ReadInt(), ReadInt(), ReadInt()
	P := ReadInts(N)
	sort.Ints(P)
	var x, y, z int
	for _, p := range P {
		if p <= A {
			x++
		} else if A+1 <= p && p <= B {
			y++
		} else {
			z++
		}
	}
	fmt.Println(Min(x, y, z))
}

func Min(xs ...int) int {
	min := xs[0]
	for _, x := range xs[1:] {
		if min > x {
			min = x
		}
	}
	return min
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for B - Contests
	var N int
	fmt.Scanf("%d", &N)

	var A, B int
	fmt.Scanf("%d %d", &A, &B)

	var P int
	var count1, count2, count3 int
	for i := 0; i < N; i++ {
		fmt.Scanf("%d", &P)
		if P <= A {
			count1++
		} else if A < P && P <= B {
			count2++
		} else {
			count3++
		}
	}
	ans := math.Min(float64(count1), math.Min(float64(count2), float64(count3)))
	fmt.Println(ans)

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

ca = p.count { |i| i <= a }
cb = p.count { |i| i > b }

puts [ca, cb, n - ca - cb].min
//  [ruby]
_ = gets
a, b = gets.chomp.split.map(&:to_i)
p = gets.chomp.split.map(&:to_i)
f = 0
s = 0
t = 0
p.each do |i|
  if i <= a
    f += 1
  elsif i <= b
    s += 1
  else
    t += 1
  end
end
puts [f, s, t].min
//  [ruby]
n,a,b,*p=$<.read.split.map &:to_i
r=[0]*3
p.map{|x|
  r[0]+=1 if x<=a
  r[1]+=1 if a<x&&x<=b
  r[2]+=1 if b<x
}
p r.min
//  [ruby]
N,A,B,*P=`dd`.split.map &:to_i
r=0,0,0
P.map{|x|r[x<=A ? 0 : x<=B ? 1 : 2]+=1}
p r.min
//  [ruby]
n = gets.to_i
a, b = gets.chomp.split(' ').map(&:to_i)
p = gets.chomp.split(' ').map(&:to_i)
ans = [0]*3
p.each do |x|
  ans[0] += 1 if x <= a
  ans[1] += 1 if x > a && x <= b
  ans[2] += 1 if x > b
end
puts ans.min
//  [ruby]
n = gets.to_i
a, b = gets.split(" ").map(&:to_i)
array = gets.split(" ").map(&:to_i)

first = array.select{|item| item <= a}
second = array.select{|item| item >= a + 1 && item <= b}
third = array.select{|item| item >= b +1}

# p first
# p second
# p third

ans = [first.length, second.length, third.length].min
puts ans
//  [rust]
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;

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

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);

impl<T: PartialEq> Eq for Total<T> {}

impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

//const MAX:usize = 100006;
//const INF:u64 = u64::max_value();

fn main() {
    let n:usize = read();
    let a:u32 = read();
    let b:u32 = read();

    let p:Vec<u32> = (0..n).map(|_| read()).collect();

    let mut cnt = vec![0,0,0];

    for &el in p.iter() {
        if el <= a {cnt[0]+=1}
        if a < el && el <=b {cnt[1]+=1}
        if b < el {cnt[2]+=1}
    }

    println!("{}", min(cnt[0],min(cnt[1],cnt[2])));


}
//  [rust]
#![allow(unused_imports)]

use std::cmp;
use std::cmp::{max, min, Ordering};
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::io::stdin;
use std::ops::*;
use std::process::exit;
use std::str::FromStr;

#[macro_export]
macro_rules! minimum {
    ($($e:expr),+) => {
        {
            let mut res = Vec::new();
            $(
                res.push($e);
            )+
            res.into_iter().min().unwrap()
        }
    };
}

pub const MOD: usize = 1000000007;

fn main() {
    let n: usize = input();
    let (a, b): (usize, usize) = input_two();
    let p: Vec<usize> = input_vec();

    let mut f = 0usize;
    let mut s = 0usize;
    let mut t = 0usize;

    for i in p {
        if i <= a {
            f += 1;
        } else if i <= b {
            s += 1;
        } else {
            t += 1;
        }
    }

    let ans = minimum!(f, s, t);
    println!("{}", ans);
}

pub fn input<T: FromStr>() -> T {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().ok().unwrap()
}

pub fn input_vec<T: FromStr>() -> Vec<T> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim()
        .split_whitespace()
        .map(|x| x.parse().ok().unwrap())
        .collect::<Vec<_>>()
}

pub fn input_lines<T: FromStr>(l: usize) -> Vec<T> {
    let mut res = Vec::new();
    for _i in 0..l {
        res.push(input());
    }
    res
}

pub fn input_lines_two<T: FromStr, U: FromStr>(l: usize) -> Vec<(T, U)> {
    let mut res = Vec::new();
    for _i in 0..l {
        res.push(input_two());
    }
    res
}

pub fn input_lines_three<T: FromStr, U: FromStr, V: FromStr>(l: usize) -> Vec<(T, U, V)> {
    let mut res = Vec::new();
    for _i in 0..l {
        res.push(input_three());
    }
    res
}

pub fn input_two<T: FromStr, U: FromStr>() -> (T, U) {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    let s: Vec<&str> = buf.split_whitespace().collect();
    (
        s[0].parse::<T>().ok().unwrap(),
        s[1].parse::<U>().ok().unwrap(),
    )
}

pub fn input_three<T: FromStr, U: FromStr, V: FromStr>() -> (T, U, V) {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    let s: Vec<&str> = buf.split_whitespace().collect();
    (
        s[0].parse::<T>().ok().unwrap(),
        s[1].parse::<U>().ok().unwrap(),
        s[2].parse::<V>().ok().unwrap(),
    )
}

pub fn input_four<T: FromStr, U: FromStr, V: FromStr, W: FromStr>() -> (T, U, V, W) {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    let s: Vec<&str> = buf.split_whitespace().collect();
    (
        s[0].parse().ok().unwrap(),
        s[1].parse().ok().unwrap(),
        s[2].parse().ok().unwrap(),
        s[3].parse().ok().unwrap(),
    )
}
//  [rust]
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let n = read_as_vec::<usize>()[0];
    let line = read_as_vec::<u64>();
    let (a, b) = (line[0], line[1]);
    let p =  read_as_vec::<u64>();

    let p1 = p.iter().filter(|x| **x <= a).count();
    let p2 = p.iter().filter(|x| a < **x && **x <= b).count();
    let p3 = p.iter().filter(|x| b < **x).count();

    println!("{}", cmp::min(cmp::min(p1, p2), p3));
}
//  [rust]
#[allow(unused_imports)]
use itertools::Itertools;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;

fn main() {
    input! {
        n: usize,
        a: i64, b: i64,
        p: [i64; n],
    }
    let mut p1 = 0;
    let mut p2 = 0;
    for p in p {
        if p <= a {
            p1 += 1;
        } else if p <= b {
            p2 += 1;
        }
    }
    use std::cmp::min;
    println!("{}", min(p1, min(p2, n - p1 - p2)));
}
//  [rust]
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

// reference: http://ir5.hatenablog.com/entry/20171209/1512821837

struct Scanner<'a> {
    cin: StdinLock<'a>,
}
 
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }
 
    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }
 
    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}

use std::mem;
use std::cmp;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let N: usize = sc.read();
    let A: usize = sc.read();
    let B: usize = sc.read();
    let mut s = vec![0; 3];
    for i in 0..N {
        let p: usize = sc.read();
        if p <= A {
            s[0] += 1;
        } else if p <= B {
            s[1] += 1;
        } else {
            s[2] += 1;
        }
    }
    println!("{}", cmp::min(s[2], cmp::min(s[0], s[1])));
}
//  [swift]
let N = Int(readLine()!)!
let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let A = input[0], B = input[1]
let P = readLine()!.characters.split(" ").map{Int(String($0))!}
var problems = [0, 0, 0]
for i in P {
  switch i {
  case 1...A:
    problems[0] += 1
  case A+1...B:
    problems[1] += 1
  default:
    problems[2] += 1
  }
}
print(problems.minElement()!)
//  [typescript]

function solve(N:number, A: number[]):number{
    const f=fact(N);
    let sum=0;
    for(let i=0;i<N;i++){
      sum+=mul(A[i],sub(add(tasuyatu(N-i),tasuyatu(i+1)),1));
    }
    sum=mul(sum,f);
    return sum;
  }
  function Main(raw: string) {
    const lines = raw.split("\n");
    const N = parseInt(lines[0], 10);
    const AB = lines[1].split(" ");
    const A = parseInt(AB[0], 10);
    const B = parseInt(AB[1], 10);
    const P = lines[2].split(" ").map(str=>parseInt(str, 10));
    
    let count=[0,0,0];
    P.forEach((p)=>{
        if(p<=A){
            count[0]++;
        }else if(p<=B){
            count[1]++;
        }else{
            count[2]++;
        }
    });
    const ans = count.reduce((x,y)=>Math.min(x,y),1000000);

    //出力
    console.log("%d", ans);
  }
  
  //DO NOT EDIT
  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
# coding:utf-8
m1,d1 = list(map(int, input().split()))
m2,d2 = list(map(int, input().split()))
if m1 != m2:
  print("1")
else:
  print("0")
//  [python]
# Input Values
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

# The case when the last day of the month is "31st"
if M1 == 1 or M1 == 3 or M1 == 5 or M1 == 7 or M1 == 8 or M1 == 10 or M1 == 12:
	print(1 if D1 == 31 else 0)

# The case when the last day of the month is "30th"
if M1 == 4 or M1 == 6 or M1 == 9 or M1 == 11:
	print(1 if D1 == 30 else 0)

# The case when the last day of the month is "28th"
if M1 == 2:
	print(1 if D1 == 28 else 0)
//  [python]
m, _ = [int(i) for i in input().split()]
n, _ = [int(i) for i in input().split()]
print(int(m!=n))