#include<iostream>

using namespace std;

int main()
{
  int a, b, c;
  cin>>a>>b>>c;
  int A, B, C;
  A=7-a;
  B=7-b;
  C=7-c;
  cout<<A+B+C;
}
#include<bits/stdc++.h>
using namespace std;

int main() {
  long long A,B,C,kekka;
  cin >> A >> B >> C;
  A=A%998244353;
  B=B%998244353;
  C=C%998244353;
  kekka=((A*(A+1)/2%998244353)*(B*(B+1)/2%998244353)%998244353*(C*(C+1)/2%998244353)%998244353);
  cout << kekka << endl;
}