#include using namespace std; #define FOR(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define FORR(i,l,n) for(int (i)=l;(i)<(int)(n);++(i)) void solve() { FOR(i, 9) { int n; cin >> n; if (n != i + 1){ cout << i + 1; break; } } } int main() { ios::sync_with_stdio(false); solve(); return 0; }