import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] line = br.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int m = Integer.parseInt(line[1]);
        int x = Integer.parseInt(line[2]);
        String[] str_a = br.readLine().split(" ");
        int[] a = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = Integer.parseInt(str_a[i]);
        }
        
        
        int after = 0;
        int before = 0;
        for (int aa : a) {
            if (aa > x) after++;
            else before++;
        }
        System.out.println(Math.min(after, before));
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] line = br.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int m = Integer.parseInt(line[1]);
        int x = Integer.parseInt(line[2]);
        String[] str_a = br.readLine().split(" ");
        int[] a = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = Integer.parseInt(str_a[i]);
        }
        
        
        int after = 0;
        int before = 0;
        for (int aa : a) {
            if (aa > x) after++;
            else before++;
        }
        System.out.println(Math.min(after, before));
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] line = br.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int m = Integer.parseInt(line[1]);
        int x = Integer.parseInt(line[2]);
        String[] str_a = br.readLine().split(" ");
        int[] a = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = Integer.parseInt(str_a[i]);
        }
        
        
        int after = 0;
        int before = 0;
        for (int aa : a) {
            if (aa > x) after++;
            else before++;
        }
        System.out.println(Math.min(after, before));
    } main {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] line = br.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int m = Integer.parseInt(line[1]);
        int x = Integer.parseInt(line[2]);
        String[] str_a = br.readLine().split(" ");
        int[] a = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = Integer.parseInt(str_a[i]);
        }
        
        
        int after = 0;
        int before = 0;
        for (int aa : a) {
            if (aa > x) after++;
            else before++;
        }
        System.out.println(Math.min(after, before));
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] line = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(line[0]); n Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int m = Integer.parseInt(line[1]); m Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 int x = Integer.parseInt(line[2]); x Integer.parseInt(line[2]) Integer.parseInt Integer line[2] line 2 String[] str_a = br.readLine().split(" "); str_a br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] a = new int[m]; a new int[m] m for (int i = 0; i < m; i++) {
            a[i] = Integer.parseInt(str_a[i]);
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a[i] = Integer.parseInt(str_a[i]);
        } {
            a[i] = Integer.parseInt(str_a[i]);
        } a[i] = Integer.parseInt(str_a[i]) a[i] a i Integer.parseInt(str_a[i]) Integer.parseInt Integer str_a[i] str_a i int after = 0; after 0 int before = 0; before 0 for (int aa : a) {
            if (aa > x) after++;
            else before++;
        } int aa a {
            if (aa > x) after++;
            else before++;
        } {
            if (aa > x) after++;
            else before++;
        } if (aa > x) after++;
            else before++; aa > x aa x after++ after before++ before System.out.println(Math.min(after, before)) System.out.println System.out System System.out Math.min(after, before) Math.min Math after before String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] line = br.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int m = Integer.parseInt(line[1]);
        int x = Integer.parseInt(line[2]);
        String[] str_a = br.readLine().split(" ");
        int[] a = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = Integer.parseInt(str_a[i]);
        }
        
        
        int after = 0;
        int before = 0;
        for (int aa : a) {
            if (aa > x) after++;
            else before++;
        }
        System.out.println(Math.min(after, before));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] line = br.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int m = Integer.parseInt(line[1]);
        int x = Integer.parseInt(line[2]);
        String[] str_a = br.readLine().split(" ");
        int[] a = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = Integer.parseInt(str_a[i]);
        }
        
        
        int after = 0;
        int before = 0;
        for (int aa : a) {
            if (aa > x) after++;
            else before++;
        }
        System.out.println(Math.min(after, before));
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] line = br.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int m = Integer.parseInt(line[1]);
        int x = Integer.parseInt(line[2]);
        String[] str_a = br.readLine().split(" ");
        int[] a = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = Integer.parseInt(str_a[i]);
        }
        
        
        int after = 0;
        int before = 0;
        for (int aa : a) {
            if (aa > x) after++;
            else before++;
        }
        System.out.println(Math.min(after, before));
    }
}
