import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] x = sc.nextLine().split(" ");
        String[] d = sc.nextLine().split(" ");
        int a = Integer.parseInt(x[0]);
        int c = Integer.parseInt(x[2]);

        int count = 0;
        for (int i=c; i <= a; i++) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = c; i >= 0; i--) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            }
        }
        if (count < count2) {
            System.out.println(count);
        } else {
            System.out.println(count2);
        }
    }

    static int getInt(String val) {
        return Integer.parseInt(val);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] x = sc.nextLine().split(" ");
        String[] d = sc.nextLine().split(" ");
        int a = Integer.parseInt(x[0]);
        int c = Integer.parseInt(x[2]);

        int count = 0;
        for (int i=c; i <= a; i++) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = c; i >= 0; i--) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            }
        }
        if (count < count2) {
            System.out.println(count);
        } else {
            System.out.println(count2);
        }
    }

    static int getInt(String val) {
        return Integer.parseInt(val);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] x = sc.nextLine().split(" ");
        String[] d = sc.nextLine().split(" ");
        int a = Integer.parseInt(x[0]);
        int c = Integer.parseInt(x[2]);

        int count = 0;
        for (int i=c; i <= a; i++) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = c; i >= 0; i--) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            }
        }
        if (count < count2) {
            System.out.println(count);
        } else {
            System.out.println(count2);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String[] x = sc.nextLine().split(" ");
        String[] d = sc.nextLine().split(" ");
        int a = Integer.parseInt(x[0]);
        int c = Integer.parseInt(x[2]);

        int count = 0;
        for (int i=c; i <= a; i++) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = c; i >= 0; i--) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            }
        }
        if (count < count2) {
            System.out.println(count);
        } else {
            System.out.println(count2);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] x = sc.nextLine().split(" "); x sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " String[] d = sc.nextLine().split(" "); d sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int a = Integer.parseInt(x[0]); a Integer.parseInt(x[0]) Integer.parseInt Integer x[0] x 0 int c = Integer.parseInt(x[2]); c Integer.parseInt(x[2]) Integer.parseInt Integer x[2] x 2 int count = 0; count 0 for (int i=c; i <= a; i++) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            }
        } int i=c; int i=c; i c i <= a i a i++ i++ i {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            }
        } {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            }
        } for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            } String e d {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            } {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            } if (Integer.parseInt(e) == i) {
                    count++;
                } Integer.parseInt(e) == i Integer.parseInt(e) Integer.parseInt Integer e i {
                    count++;
                } count++ count int count2 = 0; count2 0 for (int i = c; i >= 0; i--) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            }
        } int i = c; int i = c; i c i >= 0 i 0 i-- i-- i {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            }
        } {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            }
        } for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            } String e d {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            } {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            } if (Integer.parseInt(e) == i) {
                    count2++;
                } Integer.parseInt(e) == i Integer.parseInt(e) Integer.parseInt Integer e i {
                    count2++;
                } count2++ count2 if (count < count2) {
            System.out.println(count);
        } else {
            System.out.println(count2);
        } count < count2 count count2 {
            System.out.println(count);
        } System.out.println(count) System.out.println System.out System System.out count {
            System.out.println(count2);
        } System.out.println(count2) System.out.println System.out System System.out count2 String[] args args static int getInt(String val) {
        return Integer.parseInt(val);
    } getInt {
        return Integer.parseInt(val);
    } return Integer.parseInt(val); Integer.parseInt(val) Integer.parseInt Integer val String val val public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] x = sc.nextLine().split(" ");
        String[] d = sc.nextLine().split(" ");
        int a = Integer.parseInt(x[0]);
        int c = Integer.parseInt(x[2]);

        int count = 0;
        for (int i=c; i <= a; i++) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = c; i >= 0; i--) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            }
        }
        if (count < count2) {
            System.out.println(count);
        } else {
            System.out.println(count2);
        }
    }

    static int getInt(String val) {
        return Integer.parseInt(val);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] x = sc.nextLine().split(" ");
        String[] d = sc.nextLine().split(" ");
        int a = Integer.parseInt(x[0]);
        int c = Integer.parseInt(x[2]);

        int count = 0;
        for (int i=c; i <= a; i++) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = c; i >= 0; i--) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            }
        }
        if (count < count2) {
            System.out.println(count);
        } else {
            System.out.println(count2);
        }
    }

    static int getInt(String val) {
        return Integer.parseInt(val);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] x = sc.nextLine().split(" ");
        String[] d = sc.nextLine().split(" ");
        int a = Integer.parseInt(x[0]);
        int c = Integer.parseInt(x[2]);

        int count = 0;
        for (int i=c; i <= a; i++) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = c; i >= 0; i--) {
            for (String e : d) {
                if (Integer.parseInt(e) == i) {
                    count2++;
                }
            }
        }
        if (count < count2) {
            System.out.println(count);
        } else {
            System.out.println(count2);
        }
    }

    static int getInt(String val) {
        return Integer.parseInt(val);
    }
}