#include typedef long long ll; typedef long double ld; using namespace std; #define rep(i, a, n) for (int i = (a); i < (n); i++) #define per(i, a, n) for (int i = (n) - 1; i >= (a); i--) int flag[200006]; int a[200006]; int main(void) { ios::sync_with_stdio(false); int n; while(cin >> n){ int i; for(i=0;i> b; b--; a[i]=b; } int res=0; int c; for(i=0;i