#include #include #include #include #include #include using namespace std; int n,i,t,k; int a[110]; int main() { while (scanf("%d",&n)!=EOF) { for (i=1;i<=n;i++) scanf("%d",&a[i]); sort(a+1,a+n+1); t=1; for (i=2;i<=n;i++) if (a[i]!=a[i-1]) t++; scanf("%d",&k); if (t+k<=n) printf("%d\n",t); else printf("%d\n",n-k); } return 0; }