#include<bits/stdc++.h> usingnamespace std; #define ll long long #define maxn 100005 #define il inline #define mod 998244353 #define int long long int a[maxn],dp[maxn][210][3]; signedmain(){ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int n; cin>>n; for (int i = 1; i <=n ; ++i) { cin>>a[i]; } for (int i = 1; i <=200 ; ++i) { if(a[1]==-1||a[1]==i){ dp[1][i][0]=1; } } for (int i = 2; i <=n ; ++i) { int sum=0; for (int j = 1; j <=200 ; ++j) { if(a[i]==-1||a[i]==j){ dp[i][j][0]=sum; dp[i][j][1]=(dp[i-1][j][1]+dp[i-1][j][2]+dp[i-1][j][0])%mod; } sum=(sum+dp[i-1][j][1]+dp[i-1][j][2]+dp[i-1][j][0])%mod; } sum=0; for (int j = 200; j >=1 ; --j) {
if(a[i]==-1||a[i]==j){ dp[i][j][2]=sum; }sum=(sum+dp[i-1][j][1]+dp[i-1][j][2])%mod; } } ll sum=0; for (int i = 1; i <=200 ; ++i) { if(a[n]==-1||a[n]==i){ sum=(sum+dp[n][i][1]+dp[n][i][2])%mod; } } cout<<sum; return0; }