Am atasat codul mai jos......
#include <iostream>
#include <valarray>
int main()
{
int n;
std::cin >> n;
std::vector<int> a(n), b(n);
for (int & elem : a) std::cin >> elem;
for (int & elem : b) std::cin >> elem;
const std::valarray<int> dif = decltype(dif)(a.data(), a.size()) - decltype(dif)(b.data(), b.size());
std::cout << std::max(dif[dif == 1].size(), dif[dif == -1].size());
}