#include
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
if (a < 0 && b < 0 && c < 0) {
cout << "Error!" << endl;<br>} else {
if ((a - b) % 3 != 0 && (a - c) % 3 != 0 && (b - c) % 3 == 0) {
cout << "1" << endl;<br>}
if ((a - b) % 3 != 0 && (a - c) % 3 == 0 && (b - c) % 3 != 0) {
cout << "2" << endl;<br>}
if ((a - b) % 3 == 0 && (a - c) % 3 != 0 && (b - c) % 3 != 0) {
cout << "3" << endl;<br>}
}
return 0;
}