#include using namespace std; using ll = long long; using pii = pair; using vi = vector; #define fastio ios::sync_with_stdio(false); cin.tie(nullptr); #define all(x) (x).begin(), (x).end() int main() { fastio; int ans = 1; bool found = false; int temp ; for(int i=1;i<=9;i++){ cin >> temp; if(!found && temp != i){ ans = i; found = true; } } if(!found) ans = 10; cout << ans ; return 0; }