Untitled

mail@pastecode.io avatar
unknown
c_cpp
a year ago
274 B
1
Indexable
#include <iostream>
using namespace std;
int main()
{
	int a, d, b = 0, c = 0;
	cin >> a;
	for (int i = 0; i < a; i++) {
		cin >> d;
		if (d == 1) {
			b += 1;
		}
		if (d == 0) {
			c += 1;
		}
	}
	if (b > c) {
		cout << c;
	}
	else {
		cout << b;
	}
}