闰土。
#include <iostream>
using namespace std;
struct student{
bool p,q;
} stu[101];
int n,m,type,all,ans;
int main(){
cin>>n>>m>>type;
ans=n;
for(int i=1;i<=n;i++){
cin>>stu[i].p;
}
for(int i=1;i<=n;i++){
cin>>stu[i].q;
}
for(int i=1;i<=n;i++){
if(stu[i].p==1&&stu[i].q==1){
all++;
}
}
if(all>=m) ans-=all-1;
cout<<ans;
return 0;
}