/*

import "core"
import "procon"

var moneygate Array[101, Bool]

fn main() {
  n := read_int()
  m := read_int()
  x := read_int()
  for i in range(0, m-1) {
    get(moneygate, read_int()) = true
  }

  leftsum := 0
  for i in range(x, n) {
    if (get(moneygate, i)) {
      leftsum += 1
    }
  }
  rightsum := 0
  for i in range(0, x) {
    if (get(moneygate, i)) {
      rightsum += 1
    }
  }
  
  if (leftsum < rightsum) {
    println(leftsum)
  } else {
    println(rightsum)
  }
}

main()

*/
#include "stdbool.h"
#include "stdint.h"
bool core_prelude_true;
bool core_prelude_false;
bool core_definitions_is_windows;
bool core_definitions_is_compiletime;
bool core_definitions_is_runtime;
bool core_definitions_is_jscodegen;
#include "math.h"
float core_math_M_PI;
#include "stdio.h"
void* core_pointer_nullGG_() {
void* core_pointer_tmpid39 = ((void*)(0));
return core_pointer_tmpid39;
}
void* core_pointer_null;
char* core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char__core_prelude_Int(char* core_pointer_p, int64_t core_pointer_i) {
char* core_pointer_tmpid40 = ((char*)((((int64_t)(core_pointer_p)) + core_pointer_i)));
return core_pointer_tmpid40;
}
char core_string_getGG_core_prelude_CString_core_prelude_Int(char* core_string_cs, int64_t core_string_i) {
char core_string_tmpid41 = (*(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char__core_prelude_Int(((char*)(core_string_cs)), core_string_i)));
return core_string_tmpid41;
}
#include "string.h"
struct core_string_String {
char* p;
int64_t len;
};
char core_string_charGG_core_prelude_Int(int64_t core_string_c) {
char core_string_tmpid44 = ((char)(core_string_c));
return core_string_tmpid44;
}
char core_string_cr;
char core_string_lf;
#include "inttypes.h"
int64_t procon_read_intGG_() {
int64_t procon_ret;
scanf("%" PRId64, &procon_ret);
int64_t procon_tmpid65 = procon_ret;
return procon_tmpid65;
}
struct Array1024_core_prelude_Char { char data[1024]; };
bool procon_is_debug;
struct Array101_core_prelude_Bool { bool data[101]; };
struct Array101_core_prelude_Bool b_moneygate;
void b_mainGG_() {
int64_t b_n = procon_read_intGG_();
int64_t b_m = procon_read_intGG_();
int64_t b_x = procon_read_intGG_();
{
int64_t b_i = 0;
while ((b_i <= (b_m - 1))) {
*(&((&b_moneygate)->data[procon_read_intGG_()])) = &core_prelude_true;
;
(b_i += 1);
};

}
;
;
;
int64_t b_leftsum = 0;
{
int64_t b_i = b_x;
while ((b_i <= b_n)) {
if (*(&((&b_moneygate)->data[b_i]))) {
(b_leftsum += 1);
} else {};
(b_i += 1);
};

}
;
;
;
int64_t b_rightsum = 0;
{
int64_t b_i = 0;
while ((b_i <= b_x)) {
if (*(&((&b_moneygate)->data[b_i]))) {
(b_rightsum += 1);
} else {};
(b_i += 1);
};

}
;
;
;
if ((b_leftsum < b_rightsum)) {
printf("%lld", b_leftsum);
;
;
printf("%s", "\n");
;
;
;
} else {printf("%lld", b_rightsum);
;
;
printf("%s", "\n");
;
;
;
}}

void flori_main() {
core_prelude_true = 1;
core_prelude_false = 0;
core_definitions_is_windows = 
#ifdef _WIN32
#define is_windows true
#elif _WIN64
#define is_windows true
#else
#define is_windows false
#endif
  is_windows;
core_definitions_is_compiletime = 
#ifdef FLORI_COMPILETIME
#define is_compiletime true
#else
#define is_compiletime false
#endif
  is_compiletime;
core_definitions_is_runtime = !(core_definitions_is_compiletime);
core_definitions_is_jscodegen = 
#ifdef FLORI_JSCODEGEN
#define is_jscodegen true
#else
#define is_jscodegen false
#endif
  is_jscodegen;
core_math_M_PI = M_PI;
core_pointer_null = core_pointer_nullGG_();
core_string_cr = core_string_charGG_core_prelude_Int(13);
core_string_lf = core_string_charGG_core_prelude_Int(10);
procon_is_debug = core_prelude_true;
b_mainGG_();
}
int main(int argc, char** argv) { flori_main(); }


Measured memory_bytes: 128