#include <bits/stdc++.h>
using namespace std;
#define int int64_t
const int M = 1e5 + 1;
const int MOD = 998244353;
int n, dp[M][201][2], pre[M][201][2], A[M];

int32_t main()
{
    	#ifndef ONLINE_JUDGE
    		freopen("in.txt", "r", stdin);
	    	freopen("out.txt", "w", stdout);
	#endif
    	ios_base::sync_with_stdio(0);   cin.tie(0);     cout.tie(0);
    	cin >> n;
    	for(int i = 1; i <= n; i++)	cin >> A[i];
    	if(A[1] == -1)
    	{
    		for(int j = 1; j <= 200; j++)
    			dp[1][j][0] = 1;
    	}
    	else		dp[1][A[1]][0] = 1;

    	for(int j = 1; j <= 200; j++)
    	{
    		pre[1][j][0] = (dp[1][j][0] + pre[1][j - 1][0]) % MOD;
    		pre[1][j][1] = (dp[1][j][1] + pre[1][j - 1][1]) % MOD;
    	}

    	for(int i = 2; i <= n; i++)
    	{
    		for(int j = 1; j <= 200; j++)
    		{
    			if(A[i] == -1 || A[i] == j)
    			{
    				int L = 1, R = j - 1;
    				dp[i][j][0] = (dp[i][j][0] + pre[i - 1][R][0] - pre[i - 1][L - 1][0]) % MOD;
    				dp[i][j][0] = (dp[i][j][0] + pre[i - 1][R][1] - pre[i - 1][L - 1][1]) % MOD;

    				// for third state to be zero only jth number can be used since agar j se bada
    				// number liya toh (i - 1)th position ke dono neighbours chote ho jayenge
    				dp[i][j][1] = (dp[i][j][1] + pre[i - 1][j][0] - pre[i - 1][j - 1][0]) % MOD;

    				L = j, R = 200;
    				// last wala element iske equal hoga ya bada hoga aur uske last wala element bada hoga
    				// toh condition satisfied
    				dp[i][j][1] = (dp[i][j][1] + pre[i - 1][R][1] - pre[i - 1][L - 1][1]) % MOD;
    			}
    		}
    		for(int j = 1; j <= 200; j++)
    		{
    			pre[i][j][0] = (dp[i][j][0] + pre[i][j - 1][0]) % MOD;
    			pre[i][j][1] = (dp[i][j][1] + pre[i][j - 1][1]) % MOD;
    		}
    	}
    	int ans = 0;
    	for(int j = 1; j <= 200; j++)
    		ans = (ans + dp[n][j][1]) % MOD;
    	cout << ans << endl;
    	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 5;
const int MOD = 998244353;
int n, dp[M][201][2], pre[M][201][2], A[M];

int32_t main()
{
    	#ifndef ONLINE_JUDGE
    		freopen("in.txt", "r", stdin);
	    	freopen("out.txt", "w", stdout);
	#endif
    	ios_base::sync_with_stdio(0);   cin.tie(0);     cout.tie(0);
    	cin >> n;
    	for(int i = 1; i <= n; i++)	cin >> A[i];
    	if(A[1] == -1)
    	{
    		for(int j = 1; j <= 200; j++)
    			dp[1][j][0] = 1;
    	}
    	else		dp[1][A[1]][0] = 1;

    	for(int j = 1; j <= 200; j++)
    	{
    		pre[1][j][0] = (dp[1][j][0] + pre[1][j - 1][0]) % MOD;
    		pre[1][j][1] = (dp[1][j][1] + pre[1][j - 1][1]) % MOD;
    	}

    	for(int i = 2; i <= n; i++)
    	{
    		for(int j = 1; j <= 200; j++)
    		{
    			if(A[i] == -1 || A[i] == j)
    			{
    				int L = 1, R = j - 1;
    				dp[i][j][0] = (dp[i][j][0] + (pre[i - 1][R][0] - pre[i - 1][L - 1][0] + MOD) % MOD) % MOD;

    				dp[i][j][0] = (dp[i][j][0] + (pre[i - 1][R][1] - pre[i - 1][L - 1][1] + MOD) % MOD) % MOD;

    				// for third state to be zero only jth number can be used since agar j se bada
    				// number liya toh (i - 1)th position ke dono neighbours chote ho jayenge
    				dp[i][j][1] = (dp[i][j][1] + (pre[i - 1][j][0] - pre[i - 1][j - 1][0] + MOD) % MOD) % MOD;

    				L = j, R = 200;
    				// last wala element iske equal hoga ya bada hoga aur uske last wala element bada hoga
    				// toh condition satisfied
    				dp[i][j][1] = (dp[i][j][1] + (pre[i - 1][R][1] - pre[i - 1][L - 1][1] + MOD) % MOD) % MOD;
    			}
    		}
    		for(int j = 1; j <= 200; j++)
    		{
    			pre[i][j][0] = (dp[i][j][0] + pre[i][j - 1][0]) % MOD;
    			pre[i][j][1] = (dp[i][j][1] + pre[i][j - 1][1]) % MOD;
    		}
    	}
    	int ans = 0;
    	for(int j = 1; j <= 200; j++)
    		ans = (ans + dp[n][j][1]) % MOD;
    	cout << ans << endl;
    	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int int64_t
const int M = 1e5 + 5;
const int MOD = 998244353;
int n, dp[M][210][2], pre[M][210][2], A[M];

int32_t main()
{
    	#ifndef ONLINE_JUDGE
    		freopen("in.txt", "r", stdin);
	    	freopen("out.txt", "w", stdout);
	#endif
    	ios_base::sync_with_stdio(0);   cin.tie(0);     cout.tie(0);
    	cin >> n;
    	for(int i = 1; i <= n; i++)	cin >> A[i];
    	if(A[1] == -1)
    	{
    		for(int j = 1; j <= 200; j++)
    			dp[1][j][0] = 1;
    	}
    	else		dp[1][A[1]][0] = 1;

    	for(int j = 1; j <= 200; j++)
    	{
    		pre[1][j][0] = (dp[1][j][0] + pre[1][j - 1][0]) % MOD;
    		pre[1][j][1] = (dp[1][j][1] + pre[1][j - 1][1]) % MOD;
    	}

    	for(int i = 2; i <= n; i++)
    	{
    		for(int j = 1; j <= 200; j++)
    		{
    			if(A[i] == -1 || A[i] == j)
    			{
    				int L = 1, R = j - 1;
    				dp[i][j][0] = (dp[i][j][0] + pre[i - 1][R][0] - pre[i - 1][L - 1][0]) % MOD;
    				dp[i][j][0] = (dp[i][j][0] + pre[i - 1][R][1] - pre[i - 1][L - 1][1]) % MOD;

    				// for third state to be zero only jth number can be used since agar j se bada
    				// number liya toh (i - 1)th position ke dono neighbours chote ho jayenge
    				dp[i][j][1] = (dp[i][j][1] + pre[i - 1][j][0] - pre[i - 1][j - 1][0]) % MOD;

    				L = j, R = 200;
    				// last wala element iske equal hoga ya bada hoga aur uske last wala element bada hoga
    				// toh condition satisfied
    				dp[i][j][1] = (dp[i][j][1] + pre[i - 1][R][1] - pre[i - 1][L - 1][1]) % MOD;
    			}
    		}
    		for(int j = 1; j <= 200; j++)
    		{
    			pre[i][j][0] = (dp[i][j][0] + pre[i][j - 1][0]) % MOD;
    			pre[i][j][1] = (dp[i][j][1] + pre[i][j - 1][1]) % MOD;
    		}
    	}
    	int ans = 0;
    	for(int j = 1; j <= 200; j++)
    		ans = (ans + dp[n][j][1]) % MOD;
    	cout << ans << endl;
    	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int int64_t
const int M = 1e5 + 2;
const int MOD = 998244353;
int n, dp[M][210][2], pre[M][210][2], A[M];

int32_t main()
{
    	#ifndef ONLINE_JUDGE
    		freopen("in.txt", "r", stdin);
	    	freopen("out.txt", "w", stdout);
	#endif
    	ios_base::sync_with_stdio(0);   cin.tie(0);     cout.tie(0);
    	cin >> n;
    	for(int i = 1; i <= n; i++)	cin >> A[i];
    	if(A[1] == -1)
    	{
    		for(int j = 1; j <= 200; j++)
    			dp[1][j][0] = 1;
    	}
    	else		dp[1][A[1]][0] = 1;

    	for(int j = 1; j <= 200; j++)
    	{
    		pre[1][j][0] = (dp[1][j][0] + pre[1][j - 1][0]) % MOD;
    		pre[1][j][1] = (dp[1][j][1] + pre[1][j - 1][1]) % MOD;
    	}

    	for(int i = 2; i <= n; i++)
    	{
    		for(int j = 1; j <= 200; j++)
    		{
    			if(A[i] == -1 || A[i] == j)
    			{
    				int L = 1, R = j - 1;
    				dp[i][j][0] = (dp[i][j][0] + pre[i - 1][R][0] - pre[i - 1][L - 1][0]) % MOD;
    				dp[i][j][0] = (dp[i][j][0] + pre[i - 1][R][1] - pre[i - 1][L - 1][1]) % MOD;

    				// for third state to be zero only jth number can be used since agar j se bada
    				// number liya toh (i - 1)th position ke dono neighbours chote ho jayenge
    				dp[i][j][1] = (dp[i][j][1] + pre[i - 1][j][0] - pre[i - 1][j - 1][0]) % MOD;

    				L = j, R = 200;
    				// last wala element iske equal hoga ya bada hoga aur uske last wala element bada hoga
    				// toh condition satisfied
    				dp[i][j][1] = (dp[i][j][1] + pre[i - 1][R][1] - pre[i - 1][L - 1][1]) % MOD;
    			}
    		}
    		for(int j = 1; j <= 200; j++)
    		{
    			pre[i][j][0] = (dp[i][j][0] + pre[i][j - 1][0]) % MOD;
    			pre[i][j][1] = (dp[i][j][1] + pre[i][j - 1][1]) % MOD;
    		}
    	}
    	int ans = 0;
    	for(int j = 1; j <= 200; j++)
    		ans = (ans + dp[n][j][1]) % MOD;
    	cout << ans << endl;
    	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define y1 y11
#define fi first
#define se second
#define pi acos(-1.0)
#define LL long long
//#define mp make_pair
#define pb push_back
#define ls rt<<1, l, m
#define rs rt<<1|1, m+1, r
#define ULL unsigned LL
#define pll pair<LL, LL>
#define pli pair<LL, int>
#define pii pair<int, int>
#define piii pair<pii, int>
#define pdd pair<double, double>
#define mem(a, b) memset(a, b, sizeof(a))
#define debug(x) cerr << #x << " = " << x << "\n";
#define fio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//head

const int N = 1e5 + 5, M = 205;
const int MOD = 998244353;
int a[N], dp[N][M][2], sum[M][2], n;
int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    if(n == 2) {
        int l = 1, r = 200;
        if(a[1] != -1) l = r = a[1];
        if(a[2] != -1) l = max(l, a[2]), r = min(r, a[2]);
        int ans = r-l+1;
        if(ans < 0) ans = 0;
        printf("%d\n", ans);
    }
    else {
        int tot;
        for (int i = 1; i <= n; ++i) {
            int l = 1, r = 200;
            if(a[i] != -1) l = r = a[i];
            if(i == 1) {
                for (int j = r; j >= l; --j) sum[j][0] = sum[j][1] = 1;
                for (int j = l-1; j >= 1; --j) sum[j][0] = sum[l][0];
                for (int j = r+1; j <= 200; ++j) sum[j][1] = sum[r][1];
            }
            else {
                for (int j = l; j <= r; ++j) {
                    if(i != 2) dp[i][j][0] = sum[j+1][0];
                    dp[i][j][1] = sum[j][1];
                }
                tot = 0;
                for (int j = 1; j <= 200; ++j) sum[j][0] = sum[j][1] = 0;
                for (int j = r; j >= l; --j) sum[j][0] = ((sum[j+1][0] + dp[i][j][0]) % MOD /*+ dp[i][j][1] - dp[i][j-1][1]*/) % MOD, tot = ((tot + dp[i][j][0])%MOD + dp[i][j][1]) % MOD;
                for (int j = l-1; j >= 1; --j) sum[j][0] = sum[l][0];
                for (int j = l; j <= 200; ++j) sum[j][1] = tot;
            }
        }
        tot = 0;
        for (int i = 1; i <= 200; ++i) tot = (tot + dp[n][i][1]) % MOD;
        printf("%d\n", tot);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define y1 y11
#define fi first
#define se second
#define pi acos(-1.0)
#define LL long long
//#define mp make_pair
#define pb push_back
#define ls rt<<1, l, m
#define rs rt<<1|1, m+1, r
#define ULL unsigned LL
#define pll pair<LL, LL>
#define pli pair<LL, int>
#define pii pair<int, int>
#define piii pair<pii, int>
#define pdd pair<double, double>
#define mem(a, b) memset(a, b, sizeof(a))
#define debug(x) cerr << #x << " = " << x << "\n";
#define fio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//head

const int N = 1e5 + 5, M = 205;
const int MOD = 998244353;
int a[N], dp[N][M][3], sum[M][2], n;
int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    if(n == 2) {
        int l = 1, r = 200;
        if(a[1] != -1) l = r = a[1];
        if(a[2] != -1) l = max(l, a[2]), r = min(r, a[2]);
        int ans = r-l+1;
        if(ans < 0) ans = 0;
        printf("%d\n", ans);
    }
    else {
        for (int i = 1; i <= n; ++i) {
            int l = 1, r = 200;
            if(a[i] != -1) l = r = a[i];
            if(i == 1) {
                for (int j = l; j <= r; ++j) dp[i][j][2] = 1;
            }
            else {
                for (int j = l; j <= r; ++j) {
                     if(i != 2) dp[i][j][1] = sum[j+1][1];
                     dp[i][j][0] = sum[j-1][0];
                     dp[i][j][2] = ((dp[i-1][j][0] + dp[i-1][j][1])%MOD + dp[i-1][j][2]) % MOD;
                }
            }
            for (int j = 1; j <= 200; ++j) sum[j][0] = ((sum[j-1][0] + dp[i][j][0])%MOD + dp[i][j][2]) % MOD;
            for (int j = 200; j >= 1; --j) sum[j][1] = ((sum[j+1][1] + dp[i][j][1])%MOD + dp[i][j][2]) % MOD;
        }
        int res = 0;
        for (int i = 1; i <= 200; ++i) res = ((res + dp[n][i][1])%MOD + dp[n][i][2])%MOD;
        printf("%d\n", res);
    }
    return 0;
}


#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize(4)
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pi acos(-1.0)
#define LL long long
//#define mp make_pair
#define pb push_back
#define ls rt<<1, l, m
#define rs rt<<1|1, m+1, r
#define ULL unsigned LL
#define pll pair<LL, LL>
#define pli pair<LL, int>
#define pii pair<int, int>
#define piii pair<pii, int>
#define mem(a, b) memset(a, b, sizeof(a))
#define fio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define fopen freopen("in.txt", "r", stdin);freopen("out.txt", "w", stout);
//head

const int N = 1e5 + 5;
const int MOD = 998244353;
int a[N];
int main() {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    if(n <= 2) {
        int ans = 0;
        for (int i = 1; i <= n; i++) if(a[i]!=-1) ans = a[i];
        if(ans) puts("1");
        else puts("200");
    }
    else {
        int mid = 0;
        LL ans = 0;
        for (int i = 2; i <= n-1; i++) if(a[i]!=-1) mid = a[i];
        if(mid) {
            if(a[1] == -1 && a[n] == -1) {
                if(n == 3) ans = mid + mid - 1;
                else ans = mid * mid;
            }
            else if(a[1] == -1) {
                if(n == 3) {
                    if(a[n] != mid) ans = 1;
                    else ans = mid;
                }
                else ans = mid;
            }
            else if(a[n] == -1) {
                if(n == 3) {
                    if(a[1] != mid) ans = 1;
                    else ans = mid;
                }
                else ans = mid;
            }
            else {
                ans = 1;
            }
        }
        else {
            if(n == 3 && a[1] != -1 && a[n] != -1) ans = 1;
            else for (int mid = max(1, max(a[1], a[n])); mid <= 200; mid++) {
                if(a[1] == -1 && a[n] == -1) {
                    if(n == 3) (ans += mid + mid - 1) %= MOD;
                    else (ans += mid * mid) % MOD;;
                }
                else if(a[1] == -1) {
                    if(n == 3) {
                        if(a[n] != mid) (ans += 1) %= MOD;
                        else (ans += mid) %= MOD;
                    }
                    else (ans += mid) %= MOD;
                }
                else if(a[n] == -1) {
                    if(n == 3) {
                        if(a[1] != mid) (ans += 1) %= MOD;
                        else (ans += mid) %= MOD;
                    }
                    else (ans += mid) %= MOD;
                }
                else {
                    (ans += 1) %= MOD;
                }
            }
        }
        printf("%lld\n", ans);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define y1 y11
#define fi first
#define se second
#define pi acos(-1.0)
#define LL long long
//#define mp make_pair
#define pb push_back
#define ls rt<<1, l, m
#define rs rt<<1|1, m+1, r
#define ULL unsigned LL
#define pll pair<LL, LL>
#define pli pair<LL, int>
#define pii pair<int, int>
#define piii pair<pii, int>
#define pdd pair<double, double>
#define mem(a, b) memset(a, b, sizeof(a))
#define debug(x) cerr << #x << " = " << x << "\n";
#define fio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//head

const int N = 1e5 + 5, M = 205;
const int MOD = 998244353;
int a[N], dp[N][M][3], sum[M][2], n;
int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    if(n == 2) {
        int l = 1, r = 200;
        if(a[1] != -1) l = r = a[1];
        if(a[2] != -1) l = max(l, a[2]), r = min(r, a[2]);
        int ans = r-l+1;
        if(ans < 0) ans = 0;
        printf("%d\n", ans);
    }
    else {
        for (int i = 1; i <= n; ++i) {
            int l = 1, r = 200;
            if(a[i] != -1) l = r = a[i];
            if(i == 1) {
                for (int j = l; j <= r; ++j) dp[i][j][2] = 1;
            }
            else {
                for (int j = l; j <= r; ++j) {
                     if(i != 2) dp[i][j][1] = sum[j+1][1];
                     dp[i][j][0] = sum[j-1][0];
                     dp[i][j][2] = ((dp[i-1][j][0] + dp[i-1][j][1])%MOD + dp[i-1][j][2]) % MOD;
                }
            }
            for (int j = 1; j <= 200; ++j) sum[j][0] = (((sum[j-1][0] + dp[i][j][0])%MOD + dp[i][j][2]) % MOD + dp[i][j][1]) % MOD;
            for (int j = 200; j >= 1; --j) sum[j][1] = ((sum[j+1][1] + dp[i][j][1])%MOD + dp[i][j][2]) % MOD;
        }
        int res = 0;
        for (int i = 1; i <= 200; ++i) res = ((res + dp[n][i][1])%MOD + dp[n][i][2])%MOD;
        printf("%d\n", res);
    }
    return 0;
}
/*
37
52 52 66 149 149 130 47 47 26 110 185 -1 73 73 65 -1 -1 130 -1 -1 -1 94 97 190 -1 -1 49 49 54 -1 92 92 5 25 48 79 79
*/


#include<bits/stdc++.h>
using namespace std;

#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define ppb           pop_back()
#define ppb           pop_back()
#define B(c)          (c).begin()
#define E(c)          (c).end()
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend()
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a,b)      (a * (b / __gcd(a,b)))
#define inf           (int)(9e18)
#define err           cerr << "move" << '\n';
#define endl          '\n'
#define pow(x, n)     (int)(pow(x, n))
#define mp            make_pair

typedef vector<int>                           vi;
typedef pair<int,int>                         pii;
typedef vector<pii>                           vpi;
typedef vector<vector<int> >                  vvi;;
typedef priority_queue<pii, vector<pii>, greater<pii> > pq;

const int MOD = 998244353;

void solve(){
    int n;
    cin >> n;
    int dp[n+1][201][2], a[n+1];
    memset(dp, 0, sizeof(dp));
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }
    for(int j = 1; j <= 200 && a[1] == -1; j++){
        dp[1][j][1] = 1;
    }
    if(a[1] != -1){
        dp[1][a[1]][1] = 1;
    }
    for(int i = 2; i <= n; i++){
        for(int j = 1; j <= 200 && a[i] == -1; j++){
            dp[i][j][0] = dp[i-1][j][1];
            dp[i][j][1] = (dp[i-1][j-1][0]+dp[i-1][j-1][1])%MOD;
        }
        if(a[i] != -1)
            dp[i][a[i]][0] = dp[i-1][a[i]-1][1],
            dp[i][a[i]][1] = (dp[i-1][a[i]-1][1]+dp[i-1][a[i]-1][0])%MOD;
        for(int j = 1; j <= 200; j++){
            dp[i][j][1] = (dp[i][j-1][1]+dp[i][j][1])%MOD;
            dp[i][j][0] = (dp[i][j-1][0]+dp[i][j][0])%MOD;
        }
    }
    if(a[n] == -1){
        cout << dp[n][200][0] << endl;
    }
    else cout << dp[n][a[n]][0] << endl;
}

signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    clock_t start, end;
    start = clock();

    cout << fixed << setprecision(15);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif

    //cin >> t;

    while(t--){
        solve();
    }

    end = clock();
    double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
    // cerr<<time_taken;
}


#include<bits/stdc++.h>
using namespace std;

//#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define ppb           pop_back()
#define ppb           pop_back()
#define B(c)          (c).begin()
#define E(c)          (c).end()
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend()
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a,b)      (a * (b / __gcd(a,b)))
#define inf           (int)(9e18)
#define err           cerr << "move" << '\n';
#define endl          '\n'
#define pow(x, n)     (int)(pow(x, n))
#define mp            make_pair

typedef vector<int>                           vi;
typedef pair<int,int>                         pii;
typedef vector<pii>                           vpi;
typedef vector<vector<int> >                  vvi;;
typedef priority_queue<pii, vector<pii>, greater<pii> > pq;

const int MOD = 998244353;

void solve(){
    int n;
    cin >> n;
    int dp[n+1][201][2], a[n+1];
    memset(dp, 0, sizeof(dp));
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }
    for(int j = 1; j <= 200 && a[1] == -1; j++){
        dp[1][j][1] = 1;
    }
    if(a[1] != -1){
        dp[1][a[1]][1] = 1;
    }
    for(int i = 2; i <= n; i++){
        for(int j = 1; j <= 200 && a[i] == -1; j++){
            dp[i][j][0] = dp[i-1][j][1];
            dp[i][j][1] = (dp[i-1][j][0]+dp[i-1][j][1])%MOD;
        }
        if(a[i] != -1)
            dp[i][a[i]][0] = dp[i-1][a[i]][1],
            dp[i][a[i]][1] = (dp[i-1][a[i]][1]+dp[i-1][a[i]][0])%MOD;
        for(int j = 1; j <= 200; j++){
            dp[i][j][1] = (dp[i][j-1][1]+dp[i][j][1])%MOD;
            dp[i][j][0] = (dp[i][j-1][0]+dp[i][j][0])%MOD;
        }
    }
    if(a[n] == -1){
        cout << dp[n][200][0] << endl;
    }
    else cout << dp[n][a[n]][0] << endl;
}

signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    clock_t start, end;
    start = clock();

    cout << fixed << setprecision(15);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif

    //cin >> t;

    while(t--){
        solve();
    }

    end = clock();
    double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
    // cerr<<time_taken;
}


#include<bits/stdc++.h>
using namespace std;

#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define ppb           pop_back()
#define ppb           pop_back()
#define B(c)          (c).begin()
#define E(c)          (c).end()
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend()
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a,b)      (a * (b / __gcd(a,b)))
#define inf           (int)(9e18)
#define err           cerr << "move" << '\n';
#define endl          '\n'
#define pow(x, n)     (int)(pow(x, n))
#define mp            make_pair

typedef vector<int>                           vi;
typedef pair<int,int>                         pii;
typedef vector<pii>                           vpi;
typedef vector<vector<int> >                  vvi;;
typedef priority_queue<pii, vector<pii>, greater<pii> > pq;

const int MOD = 998244353;

void solve(){
    int n;
    cin >> n;
    int dp[n+1][201][2], sum[n+1][201][2], a[n+1];
    memset(dp, 0, sizeof(dp));
    memset(sum, 0, sizeof(sum));
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }
    for(int j = 1; j <= 200 && a[1] == -1; j++){
        dp[1][j][1] = sum[1][j][1] = 1;
    }
    if(a[1] != -1){
        dp[1][a[1]][1] = sum[1][a[1]][1] = 1;
    }
    for(int i = 2; i <= n; i++){
        for(int j = 1; j <= 200 && a[i] == -1; j++){
            dp[i][j][0] = sum[i-1][j][1];
            dp[i][j][1] = (sum[i-1][j-1][0]+sum[i-1][j-1][1])%MOD;
        }
        if(a[i] != -1)
            dp[i][a[i]][0] = sum[i-1][a[i]][1],
            dp[i][a[i]][1] = (sum[i-1][a[i]-1][1]+sum[i-1][a[i]-1][0])%MOD;
        for(int j = 1; j <= 200; j++){
            sum[i][j][1] = (sum[i][j-1][1]+dp[i][j][1])%MOD;
            sum[i][j][0] = (sum[i][j-1][0]+dp[i][j][0])%MOD;
        }
    }
    if(a[n] == -1){
        cout << sum[n][200][0] << endl;
    }
    else cout << sum[n][a[n]][0] << endl;
}

signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    clock_t start, end;
    start = clock();

    cout << fixed << setprecision(15);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif

    //cin >> t;

    while(t--){
        solve();
    }

    end = clock();
    double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
    // cerr<<time_taken;
}


#include<bits/stdc++.h>
using namespace std;

#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define ppb           pop_back()
#define ppb           pop_back()
#define B(c)          (c).begin()
#define E(c)          (c).end()
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend()
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a,b)      (a * (b / __gcd(a,b)))
#define inf           (int)(9e18)
#define err           cerr << "move" << '\n';
#define endl          '\n'
#define pow(x, n)     (int)(pow(x, n))
#define mp            make_pair

typedef vector<int>                           vi;
typedef pair<int,int>                         pii;
typedef vector<pii>                           vpi;
typedef vector<vector<int> >                  vvi;;
typedef priority_queue<pii, vector<pii>, greater<pii> > pq;

const int MOD = 998244353, N = 1e5+1;
int dp[N][202][2], sum[202];

void solve(){
    int n, a;
    cin >> n >> a;
    for(int j = 1; j <= 200; j++){
        dp[1][j][1] = dp[1][j-1][1];
        if(a != -1 && a != j)continue;
        dp[1][j][1] += 1;
    }
    //cout << dp[1][200][1] << endl;
    for(int i = 2; i <= n; i++){
        cin >> a;
        for(int j = 1; j <= 200; j++){
            if(a != -1 && a != j)continue;
            dp[i][j][0] = (dp[i-1][j][1]-dp[i-1][j-1][1]+MOD)%MOD;
            dp[i][j][0] += (dp[i-1][200][0]-dp[i-1][j-1][0]+MOD)%MOD;
            dp[i][j][1] = (dp[i-1][j-1][0]+dp[i-1][j-1][1])%MOD;
            dp[i][j][0] %= MOD;
        }
        for(int j = 1; j <= 200; j++){
            dp[i][j][1] = (dp[i][j-1][1]+dp[i][j][1])%MOD;
            dp[i][j][0] = (dp[i][j-1][0]+dp[i][j][0])%MOD;
        }
    }
    if(a == -1){
        cout << dp[n][200][0] << endl;
    }
    else cout << dp[n][a][0] << endl;
}

signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    clock_t start, end;
    start = clock();

    cout << fixed << setprecision(15);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif

    //cin >> t;

    while(t--){
        solve();
    }

    end = clock();
    double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
    // cerr<<time_taken;
}


#include<bits/stdc++.h>
using namespace std;

#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define ppb           pop_back()
#define ppb           pop_back()
#define B(c)          (c).begin()
#define E(c)          (c).end()
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend()
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a,b)      (a * (b / __gcd(a,b)))
#define inf           (int)(9e18)
#define err           cerr << "move" << '\n';
#define endl          '\n'
#define pow(x, n)     (int)(pow(x, n))
#define mp            make_pair

typedef vector<int>                           vi;
typedef pair<int,int>                         pii;
typedef vector<pii>                           vpi;
typedef vector<vector<int> >                  vvi;;
typedef priority_queue<pii, vector<pii>, greater<pii> > pq;

const int MOD = 998244353, N = 1e5+1;
int dp[N][201][2];

void solve(){
    int n, a;
    cin >> n;
    cin >> a;
    for(int j = 1; j <= 200 && a == -1; j++){
        dp[1][j][1] = 1;
    }
    if(a != -1){
        dp[1][a][1] = 1;
    }
    for(int i = 2; i <= n; i++){
        cin >> a;
        for(int j = 1; j <= 200 && a == -1; j++){
            dp[i][j][0] = dp[i-1][j][1];
            dp[i][j][1] = (dp[i-1][j][0]+dp[i-1][j][1])%MOD;
        }
        if(a != -1)
            dp[i][a][0] = dp[i-1][a][1],
            dp[i][a][1] = (dp[i-1][a][1]+dp[i-1][a][0])%MOD;
        for(int j = 1; j <= 200; j++){
            dp[i][j][1] = (dp[i][j-1][1]+dp[i][j][1])%MOD;
            dp[i][j][0] = (dp[i][j-1][0]+dp[i][j][0])%MOD;
        }
    }
    if(a == -1){
        cout << dp[n][200][0] << endl;
    }
    else cout << dp[n][a][0] << endl;
}

signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    clock_t start, end;
    start = clock();

    cout << fixed << setprecision(15);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif

    //cin >> t;

    while(t--){
        solve();
    }

    end = clock();
    double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
    // cerr<<time_taken;
}


#include<bits/stdc++.h>
using namespace std;

#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define ppb           pop_back()
#define ppb           pop_back()
#define B(c)          (c).begin()
#define E(c)          (c).end()
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend()
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a,b)      (a * (b / __gcd(a,b)))
#define inf           (int)(9e18)
#define err           cerr << "move" << '\n';
#define endl          '\n'
#define pow(x, n)     (int)(pow(x, n))
#define mp            make_pair

typedef vector<int>                           vi;
typedef pair<int,int>                         pii;
typedef vector<pii>                           vpi;
typedef vector<vector<int> >                  vvi;;
typedef priority_queue<pii, vector<pii>, greater<pii> > pq;

const int MOD = 998244353;

void solve(){
    int n;
    cin >> n;
    int dp[n+1][201][2], a[n+1];
    memset(dp, 0, sizeof(dp));
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }
    for(int j = 1; j <= 200 && a[1] == -1; j++){
        dp[1][j][1] = 1;
    }
    if(a[1] != -1){
        dp[1][a[1]][1] = 1;
    }
    for(int i = 2; i <= n; i++){
        for(int j = 1; j <= 200 && a[i] == -1; j++){
            dp[i][j][0] = dp[i-1][j][1];
            dp[i][j][1] = (dp[i-1][j][0]+dp[i-1][j][1])%MOD;
        }
        if(a[i] != -1)
            dp[i][a[i]][0] = dp[i-1][a[i]][1],
            dp[i][a[i]][1] = (dp[i-1][a[i]][1]+dp[i-1][a[i]][0])%MOD;
        for(int j = 1; j <= 200; j++){
            dp[i][j][1] = (dp[i][j-1][1]+dp[i][j][1])%MOD;
            dp[i][j][0] = (dp[i][j-1][0]+dp[i][j][0])%MOD;
        }
    }
    if(a[n] == -1){
        cout << dp[n][200][0] << endl;
    }
    else cout << dp[n][a[n]][0] << endl;
}

signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    clock_t start, end;
    start = clock();

    cout << fixed << setprecision(15);

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif

    //cin >> t;

    while(t--){
        solve();
    }

    end = clock();
    double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
    // cerr<<time_taken;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const ll maxv = 201;
const ll maxn = (ll)1e5 + 3;
const ll mod = (ll)998244353;
ll n;
vector < ll > a;

ll dp[maxn][maxv][2];

void solve(){
    cin >> n;
    a.resize(n);
    for(ll i = 0; i < n; ++i)cin >> a[i];
    for(ll i = 0; i < n; ++i){
        for(ll j = 1; j < maxv; ++j){
            if(a[i] != -1 && a[i] != j)continue;
            for(ll k = 0; k < 2; ++k){
                if(k == 0){
                    if(i == 0){
                        dp[i][j][k] = 1;
                        continue;
                    }
                    for(ll j1 = 1; j1 < j; ++j1){
                        dp[i][j][k] += dp[i - 1][j1][0];
                        dp[i][j][k] += dp[i - 1][j1][1];
                        dp[i][j][k] %= mod;
                    }
                } else {
                    if(i == 0)continue;
                    for(ll j1 = j + 1; j1 < maxv; ++j1){
                        dp[i][j][k] += dp[i - 1][j1][1];
                        dp[i][j][k] %= mod;
                    }
                    dp[i][j][k] += dp[i - 1][j][0];
                    dp[i][j][k] += dp[i - 1][j][1];
                    dp[i][j][k] %= mod;
                }
            }
        }
    }
    ll ans = 0;
    for(ll j = 1; j < maxv; ++j){
        ans += dp[n - 1][j][1];
    }
    cout << ans << "\n";
}

signed main(){
    int t = 1;
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifdef DEBUG
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    while(t--){
        solve();
    }
}


/*-----Deep D. Savani------------
-------DAIICT,INDIA--------------
*/
#include<bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mod 998244353
#define deb(x) cout<<#x<<" : "<<x<<endl;
#define deb2(x,y) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<endl;
#define deb3(x,y,z) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\t"<<#z<<" : "<<z<<endl;
#define nax 1000010
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;

using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define T ll
#define ordered_set tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>

long long modulo(long long base,long long exponent,long long modulus);
long long choose(ll n,ll k);
ll inverse(ll a,ll m);

int dp[100005][205][2];
int prefix[100005][205][2];

int main(){

    FIO
    ll n;
    cin>>n;

    vector<ll> a(n);
    for(int i=0;i<n;i++)
        cin>>a[i];

    for(int i=1;i<=200;i++)
    {
        if(a[0]==-1 || i==a[0])
            dp[0][i][1]=1;
        prefix[0][i][1]=(prefix[0][i-1][1] + dp[0][i][1])%mod;
    }

    for(int i=1;i<n;i++)
    {

        for(int j=1;j<=200;j++)
        {

            //left big left big
            if(a[i]==-1 || (a[i]==j))
            {
            dp[i][j][0]= (prefix[i-1][200][0]-prefix[i-1][j-1][0] + mod)%mod;

            //left not big --left big

            ll temp= dp[i-1][j][1];

            dp[i][j][0]=(dp[i][j][0] +  temp) %mod;

            }

            prefix[i][j][0]=(prefix[i][j-1][0]+ dp[i][j][0])%mod;

            //left big --left not big

            if( (a[i]==-1) || (a[i]==j) )
            {
            dp[i][j][1]= (prefix[i-1][j-1][0]);

            // left not big -- left not big
            ll temp= prefix[i-1][j-1][1];

            dp[i][j][1]= (dp[i][j][1] + temp) %mod;
            }

            prefix[i][j][1]= (prefix[i][j-1][1] + dp[i][j][1])%mod;

        }

    }

    cout<<prefix[n-1][200][0]<<endl;
    return 0;
}


                                                                                /*
                  ooo        ooooo                  .o88o.     o8o
                  `88.       .888'                  888 `"     `"'
                   888b     d'888      .oooo.      o888oo     oooo      .oooo.
                   8 Y88. .P  888     `P  )88b      888       `888     `P  )88b
                   8  `888'   888      .oP"888      888        888      .oP"888
                   8    Y     888     d8(  888      888        888     d8(  888
                  o8o        o888o    `Y888""8o    o888o      o888o    `Y888""8o

                                               __
                                  |  | _ _|   /  \ |__|  |\ | _    _ _ |_  _ _
                                  |/\|(-(_|   \__/    |  | \|(_)\/(-||||_)(-|

                                                                                */
#include <bits/stdc++.h>
using namespace std;

#define int                                       long long
#define lop(i,s,e)                                for(int i=s;i<(int)e;i++)
#define rlop(i,e,s)                               for(int i=e;i>=s;i--)
#define pb                                        push_back
#define all(v)                                    v.begin(),v.end()

const int N = (int)1e5 + 2, M = 998244353, inf = INT_MAX; const long long INF = LLONG_MAX;

int arr[N], dp[N][201][2], n, prefix[2][201][2];

inline int mul(int a, int b){ return (1ll*a*b)%M; };
inline int add(int a, int b) { if( a + b < 0 ) return a + b + M; if( a + b >= M) return a + b - M; return a + b; }
     #define bug(...)                                  __f (#__VA_ARGS__, __VA_ARGS__)
     #define rtn                                       if(0)return;
     template <typename Arg1> void __f (const char* name, Arg1&& arg1) { rtn cout << name << " : " << arg1 << endl; } template <typename Arg1, typename... Args> void __f (const char* names, Arg1&& arg1, Args&&... args) { rtn const char* comma = strchr (names + 1, ','); cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...); }

void solve()
{
      cin >> n;
      for(int i = 0; i < n; i++) cin >> arr[i];
      int maxval = 200;
      lop(i, 1, maxval+1) dp[n][i][1] = 1, prefix[n%2][i][1] = i;

      for(int id = n-1; id >= 0; id--){
            int r = 1 - (id%2);
            for(int prev = 1; prev <= maxval; prev++){

                  // flag == 1
                  int &mafia = dp[id][prev][1];
                  mafia = prefix[r][prev][1];
                  mafia = add(mafia, add( prefix[r][maxval][0] , -prefix[r][prev][0] ) );
                  if( arr[id] != -1 ) mafia = dp[id+1][ arr[id] ][ ( arr[id] <= prev) ];

                  // flag == 0
                  int &nmafia = dp[id][prev][0];
                  nmafia = dp[id+1][prev][1];
                  nmafia = add(nmafia, add( prefix[r][maxval][0] , -prefix[r][prev][0] ) );
                  if( arr[id] != -1 ){
                        if( arr[id] < prev ) nmafia = 0;
                        else nmafia = dp[id+1][ (arr[id] == prev) ][1];
                  }

                  prefix[id%2][prev][1] = mafia;
                  prefix[id%2][prev][0] = nmafia;
                  //bug(id, prev, 1, mafia);
                  //bug(id, prev, 0, nmafia);
            }

            lop(i, 1, maxval + 1) prefix[id%2][i][1] += prefix[id%2][i-1][1], prefix[id%2][i][1] %= M;
            lop(i, 1, maxval + 1) prefix[id%2][i][0] += prefix[id%2][i-1][0], prefix[id%2][i][0] %= M;
      }

      int ans = 0;
      if( arr[0] != -1 ) ans = dp[1][ arr[0] ][ 0 ];
      else{
            lop(i, 1, maxval+1) ans = add(ans, dp[1][i][0]);
      }
      cout << ans << endl;
}

int32_t main()
{
      ios_base::sync_with_stdio(0);   cin.tie(0);   cout.tie(0);

      int test = 1;
      // cin >> test;
      while(test--)solve();

}


                                                                                /*
                  ooo        ooooo                  .o88o.     o8o
                  `88.       .888'                  888 `"     `"'
                   888b     d'888      .oooo.      o888oo     oooo      .oooo.
                   8 Y88. .P  888     `P  )88b      888       `888     `P  )88b
                   8  `888'   888      .oP"888      888        888      .oP"888
                   8    Y     888     d8(  888      888        888     d8(  888
                  o8o        o888o    `Y888""8o    o888o      o888o    `Y888""8o

                                               __
                                  |  | _ _|   /  \ |__|  |\ | _    _ _ |_  _ _
                                  |/\|(-(_|   \__/    |  | \|(_)\/(-||||_)(-|

                                                                                */
#include <bits/stdc++.h>
using namespace std;

#define int                                       long long
#define lop(i,s,e)                                for(int i=s;i<(int)e;i++)
#define rlop(i,e,s)                               for(int i=e;i>=s;i--)
#define pb                                        push_back
#define all(v)                                    v.begin(),v.end()

const int N = (int)1e5 + 2, M = 998244353, inf = INT_MAX; const long long INF = LLONG_MAX;

int arr[N], dp[N][201][2], n, prefix[2][201][2];

inline int mul(int a, int b){ return (1ll*a*b)%M; };
inline int add(int a, int b) { if( a + b < 0 ) return a + b + M; if( a + b >= M) return a + b - M; return a + b; }
     #define bug(...)                                  __f (#__VA_ARGS__, __VA_ARGS__)
     #define rtn                                       if(0)return;
     template <typename Arg1> void __f (const char* name, Arg1&& arg1) { rtn cout << name << " : " << arg1 << endl; } template <typename Arg1, typename... Args> void __f (const char* names, Arg1&& arg1, Args&&... args) { rtn const char* comma = strchr (names + 1, ','); cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...); }

void solve()
{
      cin >> n;
      for(int i = 0; i < n; i++) cin >> arr[i];
      int maxval = 200;
      lop(i, 1, maxval+1) dp[n][i][1] = 1, prefix[n%2][i][1] = i;

      for(int id = n-1; id >= 0; id--){
            int r = 1 - (id%2);
            for(int prev = 1; prev <= maxval; prev++){

                  // flag == 1
                  int &mafia = dp[id][prev][1];
                  mafia = prefix[r][prev][1];
                  mafia = add(mafia, add( prefix[r][maxval][0] , -prefix[r][prev][0] ) );
                  if( arr[id] != -1 ) mafia = dp[id+1][ arr[id] ][ ( arr[id] <= prev) ];

                  // flag == 0
                  int &nmafia = dp[id][prev][0];
                  nmafia = dp[id+1][prev][1];
                  nmafia = add(nmafia, add( prefix[r][maxval][0] , -prefix[r][prev][0] ) );
                  if( arr[id] != -1 ){
                        if( arr[id] < prev ) nmafia = 0;
                        else nmafia = dp[id+1][ arr[id] ][ arr[id] == prev ];
                  }

                  prefix[id%2][prev][1] = mafia;
                  prefix[id%2][prev][0] = nmafia;
                  //bug(id, prev, 1, mafia);
                  //bug(id, prev, 0, nmafia);
            }

            lop(i, 1, maxval + 1) prefix[id%2][i][1] += prefix[id%2][i-1][1], prefix[id%2][i][1] %= M;
            lop(i, 1, maxval + 1) prefix[id%2][i][0] += prefix[id%2][i-1][0], prefix[id%2][i][0] %= M;
      }

      int ans = 0;
      if( arr[0] != -1 ) ans = dp[1][ arr[0] ][ 0 ];
      else{
            lop(i, 1, maxval+1) ans = add(ans, dp[1][i][0]);
      }
      cout << ans << endl;
}

int32_t main()
{
      ios_base::sync_with_stdio(0);   cin.tie(0);   cout.tie(0);

      int test = 1;
      // cin >> test;
      while(test--)solve();

}


                                                                                /*
                  ooo        ooooo                  .o88o.     o8o
                  `88.       .888'                  888 `"     `"'
                   888b     d'888      .oooo.      o888oo     oooo      .oooo.
                   8 Y88. .P  888     `P  )88b      888       `888     `P  )88b
                   8  `888'   888      .oP"888      888        888      .oP"888
                   8    Y     888     d8(  888      888        888     d8(  888
                  o8o        o888o    `Y888""8o    o888o      o888o    `Y888""8o

                                               __
                                  |  | _ _|   /  \ |__|  |\ | _    _ _ |_  _ _
                                  |/\|(-(_|   \__/    |  | \|(_)\/(-||||_)(-|

                                                                                */
#include <bits/stdc++.h>
using namespace std;

#define int                                       long long
#define lop(i,s,e)                                for(int i=s;i<(int)e;i++)
#define rlop(i,e,s)                               for(int i=e;i>=s;i--)
#define pb                                        push_back
#define all(v)                                    v.begin(),v.end()

const int N = (int)1e5 + 2, M = 998244353, inf = INT_MAX; const long long INF = LLONG_MAX;

int arr[N], dp[N][201][2], n, prefix[N][201][2];

inline int mul(int a, int b){ return (1ll*a*b)%M; };
inline int add(int a, int b) { if( a + b < 0 ) return a + b + M; if( a + b >= M) return a + b - M; return a + b; }
     #define bug(...)                                  __f (#__VA_ARGS__, __VA_ARGS__)
     #define rtn                                       if(0)return;
     template <typename Arg1> void __f (const char* name, Arg1&& arg1) { rtn cout << name << " : " << arg1 << endl; } template <typename Arg1, typename... Args> void __f (const char* names, Arg1&& arg1, Args&&... args) { rtn const char* comma = strchr (names + 1, ','); cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...); }

void solve()
{
      cin >> n;
      for(int i = 0; i < n; i++) cin >> arr[i];
      int maxval = 200;
      lop(i, 1, maxval+1) dp[n][i][1] = 1, prefix[n][i][1] = i;

      for(int id = n-1; id >= 0; id--){
            for(int prev = 1; prev <= maxval; prev++){

                  // flag == 1
                  int &mafia = dp[id][prev][1];
                  mafia = prefix[id+1][prev][1];
                  mafia = add(mafia, add( prefix[id+1][maxval][0] , -prefix[id+1][prev][0] ) );
                  if( arr[id] != -1 ) mafia = dp[id+1][ arr[id] ][ ( arr[id] <= prev) ];

                  // flag == 0
                  int &nmafia = dp[id][prev][0];
                  nmafia = dp[id+1][prev][1];
                  nmafia = add(nmafia, add( prefix[id+1][maxval][0] , -prefix[id+1][prev][0] ) );
                  if( arr[id] != -1 ){
                        if( arr[id] < prev ) nmafia = 0;
                        else nmafia = dp[id+1][ (arr[id] == prev) ][1];
                  }

                  prefix[id][prev][1] = mafia;
                  prefix[id][prev][0] = nmafia;
                  //bug(id, prev, 1, mafia);
                  //bug(id, prev, 0, nmafia);
            }

            lop(i, 1, maxval + 1) prefix[id][i][1] += prefix[id][i-1][1], prefix[id][i][1] %= M;
            lop(i, 1, maxval + 1) prefix[id][i][0] += prefix[id][i-1][0], prefix[id][i][0] %= M;
      }

      int ans = 0;
      if( arr[0] != -1 ) ans = dp[1][ arr[0] ][ 0 ];
      else{
            lop(i, 1, maxval+1) ans = add(ans, dp[1][i][0]);
      }
      cout << ans << endl;
}

int32_t main()
{
      ios_base::sync_with_stdio(0);   cin.tie(0);   cout.tie(0);

      int test = 1;
      // cin >> test;
      while(test--)solve();

}


// October.cpp : Defines the entry point for the console application.
//

#include "iostream"
#include "algorithm"
#include "vector"
#include "set"
#include "string"
#include "map"
#include "stack"
#include "bitset"
#include "deque"
#include "queue"
#include "cmath"
#include "fstream"
#include "list"
#include "unordered_set"
#include "functional"
using namespace std;
typedef long long ll;
typedef long double ld;
#define int ll
#define double ld
#define all(a) a.begin(), a.end()
const int mod = 998244353ll;
const int N = 100050;
int arr[N];
int dp[N][201][2];
vector< vector<int> > pref_sum(205, vector<int>(2));
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	for (int i = (arr[0] != -1 ? arr[0] : 1); i <= 200; i++)
	{
		if (arr[0] != -1) {
			if (i >= arr[0])
				pref_sum[i][0] = 1;

		}

		else {
			pref_sum[i][0] = i;
		}
	}

	for (int pref = 1; pref < n; pref++) {
		vector<vector<int> > temp_pref(205, vector<int>(2));
		for (int a = 1; a <= 200; a++) {
			for (int flag = 0; flag < 2; flag++) {

				if (flag == 0) {
					if (arr[pref] == -1) {
						dp[pref][a][flag] += pref_sum[a - 1][0] + pref_sum[a - 1][1];
						dp[pref][a][flag] %= mod;
					}
					else {
						dp[pref][a][flag] += (pref_sum[a - 1][0] + pref_sum[a - 1][1]) * (a == arr[pref] ? 1 : 0);
						dp[pref][a][flag] %= mod;

					}
				}
				else {
					if (pref == 0)
						continue;
					if (arr[pref] == -1) {
						dp[pref][a][flag] += (pref_sum[a][0]-pref_sum[a-1][0]) + (pref_sum[200][1] - pref_sum[a - 1][1]);
						dp[pref][a][flag] %= mod;

					}
					else {
						dp[pref][a][flag] += ((pref_sum[a][0] - pref_sum[a - 1][0]) + (pref_sum[200][1] - pref_sum[a - 1][1]))*(a == arr[pref] ? 1 : 0);
						dp[pref][a][flag] %= mod;

					}
				}
			}
			temp_pref[a][0] = (temp_pref[a - 1][0] + dp[pref][a][0])%mod;
			temp_pref[a][1] = (temp_pref[a - 1][1] + dp[pref][a][1])%mod;
		}
		pref_sum = temp_pref;
	}
	cout << pref_sum[200][1];
	return 0;
}


// October.cpp : Defines the entry point for the console application.
//

#include "iostream"
#include "algorithm"
#include "vector"
#include "set"
#include "string"
#include "map"
#include "stack"
#include "bitset"
#include "deque"
#include "queue"
#include "cmath"
#include "fstream"
#include "list"
#include "unordered_set"
#include "functional"
using namespace std;
typedef long long ll;
typedef long double ld;
#define int ll
#define double ld
#define all(a) a.begin(), a.end()
const int mod = 998244353ll;
const int N = 100050;
int arr[N];
int dp[N][201][2];
vector< vector<int> > pref_sum(205, vector<int>(2));
signed main()
{
	ios::sync_with_stdio(0);
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	for (int i = arr[0] != -1 ? arr[0] : 1; i <= 200; i++)
	{
		if (arr[0] != -1) {
			if (i >= arr[0])
				pref_sum[i][0] = 1;

		}

		else {
			pref_sum[i][0] = i;
		}
	}

	for (int pref = 1; pref < n; pref++) {
		vector<vector<int> > temp_pref(205, vector<int>(2));
		for (int a = 1; a <= 200; a++) {
			for (int flag = 0; flag < 2; flag++) {

				if (flag == 0) {
					if (arr[pref] == -1) {
						dp[pref][a][flag] += pref_sum[a - 1][0] + pref_sum[a - 1][1];
						dp[pref][a][flag] %= mod;
					}
					else {
						dp[pref][a][flag] += (pref_sum[a - 1][0] + pref_sum[a - 1][1]) * (a == arr[pref] ? 1 : 0);
						dp[pref][a][flag] %= mod;

					}
				}
				else {
					if (pref == 0)
						continue;
					if (arr[pref] == -1) {
						dp[pref][a][flag] += (pref_sum[a][0]-pref_sum[a-1][0]) + (pref_sum[200][1] - pref_sum[a - 1][1]);
						dp[pref][a][flag] %= mod;

					}
					else {
						dp[pref][a][flag] += ((pref_sum[a][0] - pref_sum[a - 1][0]) + (pref_sum[200][1] - pref_sum[a - 1][1]))*(a == arr[pref] ? 1 : 0);
						dp[pref][a][flag] %= mod;

					}
				}
			}
			temp_pref[a][0] = (temp_pref[a - 1][0] + dp[pref][a][0])%mod;
			temp_pref[a][1] = (temp_pref[a - 1][1] + dp[pref][a][1])%mod;
		}
		pref_sum = temp_pref;
	}
	cout << pref_sum[200][1];
	return 0;
}


// October.cpp : Defines the entry point for the console application.
//

#include "iostream"
#include "algorithm"
#include "vector"
#include "set"
#include "string"
#include "map"
#include "stack"
#include "bitset"
#include "deque"
#include "queue"
#include "cmath"
#include "fstream"
#include "list"
#include "unordered_set"
#include "functional"
using namespace std;
typedef long long ll;
typedef long double ld;
#define int ll
#define double ld
#define all(a) a.begin(), a.end()
const int mod = 998244353ll;
const int N = 100050;
int arr[N];
int dp[N][201][2];
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	for (int i = 1; i <= 200; i++) {
		if (arr[0] == -1)
			dp[0][i][0] = 1;
		else
			dp[0][i][0] = (arr[0] == i);
	}

	for (int pref = 1; pref < n; pref++) {
		int pref_sum[205][2] = { 0 };
		for (int i = 1; i <= 200; i++) {
			pref_sum[i][0] = pref_sum[i - 1][0] + dp[pref - 1][i][0];
			pref_sum[i][1] = pref_sum[i - 1][1] + dp[pref - 1][i][1];
		}
		for (int a = 1; a <= 200; a++) {
			for (int flag = 0; flag < 2; flag++) {

				if (flag == 0) {
					if (arr[pref] == -1) {
						dp[pref][a][flag] += pref_sum[a - 1][0] + pref_sum[a - 1][1];
						dp[pref][a][flag] %= mod;
					}
					else {
						dp[pref][a][flag] += (pref_sum[a - 1][0] + pref_sum[a - 1][1]) * (a == arr[pref] ? 1 : 0);
						dp[pref][a][flag] %= mod;

					}
				}
				else {
					if (pref == 0)
						continue;
					if (arr[pref] == -1) {
						dp[pref][a][flag] += (pref_sum[a][0]-pref_sum[a-1][0]) + (pref_sum[200][1] - pref_sum[a - 1][1]);
						dp[pref][a][flag] %= mod;

					}
					else {
						dp[pref][a][flag] += ((pref_sum[a][0] - pref_sum[a - 1][0]) + (pref_sum[200][1] - pref_sum[a - 1][1]))*(a == arr[pref] ? 1 : 0);
						dp[pref][a][flag] %= mod;

					}
				}
			}
		}
	}
	int ans = 0;
	for (int i = 1; i < 201; i++) {
		ans += dp[n - 1][i][1];
		ans %= mod;
	}
	cout << ans;

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int MAX_N = 100010;
const int MAX_X = 201;
const int mod = 998244353;

int a[MAX_N];

const int LESS = 0;
const int EQUAL = 1;
const int GREATER = 2;

int dp[2][3][MAX_X];

inline int getRange(int first, int second, int left, int right) {
    int res = dp[first][second][right];

    if(left > 0) {
        res -= dp[first][second][left-1];
    }

    return (res + mod) % mod;
}

int main() {
    ios::sync_with_stdio(false);

    int n;
    cin>>n;

    for(int i = 0;i<n;++i) {
        cin>>a[i];
    }

    for(int i = 0;i<2;++i) {
        for(int j = 0;j<3;++j) {
            for(int k = 0;k<MAX_X;++k) {
                dp[i][j][k] = 0;
            }
        }
    }

    int p = 0;

    if(a[n-1] != -1) {
        dp[p][GREATER][a[n-1]] = 1;
    } else {
        for(int x = 1;x < MAX_X;++x) {
            dp[p][GREATER][x] = 1;
        }
    }

    for(int x = 2;x < MAX_X;++x) {
        dp[p][GREATER][x] += dp[p][GREATER][x-1];
    }

    p ^= 1;
    for(int i = n-2;i >= 0;--i) {
        for(int j = 0;j<3;++j) {
            for(int k = 0;k<MAX_X;++k) {
                dp[p][j][k] = 0;
            }
        }

        for(int x = 1;x < MAX_X-1;++x) {
            if(a[i] != -1 && a[i] != x) {
                continue;
            }
            for(int state = LESS;state <= EQUAL;++state) {
                dp[p][LESS][x] += getRange(p^1, state, x+1, MAX_X-1);
                dp[p][LESS][x] %= mod;
            }
        }

        for(int x = 1;x < MAX_X;++x) {
            if(a[i] != -1 && a[i] != x) {
                continue;
            }
            for(int state = 0;state < 3;++state) {
                dp[p][EQUAL][x] += getRange(p^1, state, x, x);
                dp[p][EQUAL][x] %= mod;
            }
        }

        for(int x = 1;x < MAX_X;++x) {
            if(a[i] != -1 && a[i] != x) {
                continue;
            }
            for(int state = 0;state < 3;++state) {
                dp[p][GREATER][x] += getRange(p^1, state, 1, x-1);
                dp[p][GREATER][x] %= mod;
            }
        }

        for(int state = 0;state < 3;++state) {
            for(int x = 2;x < MAX_X;++x) {
                dp[p][state][x] = (dp[p][state][x] + dp[p][state][x-1]) % mod;
            }
        }

        p ^= 1;
    }

    p ^= 1;

    int res = 0;

    for(int state = 0;state < 2;++state) {
        res += dp[p][state][MAX_X-1];
        res %= mod;
    }

    cout<<res<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int MAX_N = 100010;
const int MAX_X = 201;
const ll mod = 998244353LL;

int a[MAX_N];
ll dp[2][MAX_X][2];

int main() {
    ios::sync_with_stdio(false);

    int n;
    cin>>n;

    for(int i = 0;i<n;++i) {
        cin>>a[i];
    }

    if(n == 2) {
        ll res =1;
        if(a[0] == -1 && a[1] == -1) {
            res = 200;
        }
        cout<<res<<endl;
        return 0;
    }

    for(int i = 0;i<2;++i) {
        for(int j = 0;j<MAX_X;++j) {
            for(int k = 0;k<2;++k) {
                dp[i][j][k] = 0;
            }
        }
    }

    if(a[n-1] == -1) {
        for(int x = 1;x < MAX_X;++x) {
            dp[0][x][0] = 1;
        }
    } else {
        dp[0][a[n-1]][0] = 1;
    }

    int p = 1;

    for(int i = n-2;i >= 0;--i, p ^= 1) {
        for(int x = 1;x < MAX_X;++x) {
            for(int smaller = 0;smaller < 2;++smaller) {
                dp[p][x][smaller] = 0;

                if(a[i] != -1 && a[i] != x) {
                    continue;
                }

                if(i+1 == n-1) {
                    if(smaller) {
                        dp[p][x][smaller] = dp[p^1][x][0];
                    } else {
                        for (int y = x+1; y < MAX_X; ++y) {
                            dp[p][x][smaller] += dp[p ^ 1][y][0];
                            dp[p][x][smaller] %= mod;
                        }
                    }
                } else if(i == 0) {
                    if(!smaller) {
                        continue;
                    }

                    for(int y = x;y < MAX_X;++y) {
                        dp[p][x][smaller] += dp[p^1][y][1];
                        dp[p][x][smaller] %= mod;

                        if(y == x && i+1 < n-1) {
                            //dp[p][x][smaller] += dp[p^1][y][0];
                            dp[p][x][smaller] %= mod;
                        }
                    }
                } else {
                    int startVal = smaller ? x+1 : 1;
                    int lim = smaller ? MAX_N : x;

                    for(int y = startVal;y < lim;++y) {
                        for(int ns = smaller;ns < 2;++ns) {
                            dp[p][x][smaller] += dp[p^1][y][ns];
                            dp[p][x][smaller] %= mod;
                        }
                    }

                    if(smaller) {
                        for(int ns = 0;ns < 2;++ns) {
                            dp[p][x][smaller] += dp[p^1][x][ns];
                            dp[p][x][smaller] %= mod;
                        }
                    }
                }
            }
        }
    }

    ll res = 0;
    p ^= 1;

    for(int x = 1;x < MAX_X;++x) {
        res = (res + dp[p][x][1]) % mod;
    }

    cout<<res<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int MAX_N = 100010;
const int MAX_X = 201;
const ll mod = 998244353LL;

int a[MAX_N];

const int LESS = 0;
const int EQUAL = 1;
const int GREATER = 2;

ll dp[2][3][MAX_X];

inline ll getRange(int first, int second, int left, int right) {
    ll res = dp[first][second][right];

    if(left > 0) {
        res -= dp[first][second][left-1];
    }

    return (res + mod) % mod;
}

int main() {
    ios::sync_with_stdio(false);

    int n;
    cin>>n;

    for(int i = 0;i<n;++i) {
        cin>>a[i];
    }

    for(int i = 0;i<2;++i) {
        for(int j = 0;j<3;++j) {
            for(int k = 0;k<MAX_X;++k) {
                dp[i][j][k] = 0;
            }
        }
    }

    int p = 0;

    if(a[n-1] != -1) {
        dp[p][GREATER][a[n-1]] = 1;
    } else {
        for(int x = 1;x < MAX_X;++x) {
            dp[p][GREATER][x] = 1;
        }
    }

    for(int x = 2;x < MAX_X;++x) {
        dp[p][GREATER][x] += dp[p][GREATER][x-1];
    }

    p ^= 1;
    for(int i = n-2;i >= 0;--i) {
        for(int j = 0;j<3;++j) {
            for(int k = 0;k<MAX_X;++k) {
                dp[p][j][k] = 0;
            }
        }

        for(int x = 1;x < MAX_X-1;++x) {
            if(a[i] != -1 && a[i] != x) {
                continue;
            }
            for(int state = LESS;state <= EQUAL;++state) {
                dp[p][LESS][x] += getRange(p^1, state, x+1, MAX_X-1);
                dp[p][LESS][x] %= mod;
            }
        }

        for(int x = 1;x < MAX_X;++x) {
            if(a[i] != -1 && a[i] != x) {
                continue;
            }
            for(int state = 0;state < 3;++state) {
                dp[p][EQUAL][x] += getRange(p^1, state, x, x);
                dp[p][EQUAL][x] %= mod;
            }
        }

        for(int x = 1;x < MAX_X;++x) {
            if(a[i] != -1 && a[i] != x) {
                continue;
            }
            for(int state = 0;state < 3;++state) {
                dp[p][GREATER][x] += getRange(p^1, state, 1, x-1);
                dp[p][GREATER][x] %= mod;
            }
        }

        for(int state = 0;state < 3;++state) {
            for(int x = 2;x < MAX_X;++x) {
                dp[p][state][x] = (dp[p][state][x] + dp[p][state][x-1]) % mod;
            }
        }

        p ^= 1;
    }

    p ^= 1;

    ll res = 0;

    for(int state = 0;state < 2;++state) {
        res += dp[p][state][MAX_X-1];
        res %= mod;
    }

    cout<<res<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int MAX_N = 100010;
const int MAX_X = 201;
const ll mod = 998244353LL;

int a[MAX_N];

const int LESS = 0;
const int EQUAL = 1;
const int GREATER = 2;

ll dp[2][3][MAX_X];

ll getRange(int first, int second, int left, int right) {
    ll res = dp[first][second][right];

    if(left > 0) {
        res -= dp[first][second][left-1];
    }

    return res;
}

int main() {
    ios::sync_with_stdio(false);

    int n;
    cin>>n;

    for(int i = 0;i<n;++i) {
        cin>>a[i];
    }

    for(int i = 0;i<2;++i) {
        for(int j = 0;j<3;++j) {
            for(int k = 0;k<MAX_X;++k) {
                dp[i][j][k] = 0;
            }
        }
    }

    int p = 0;

    if(a[n-1] != -1) {
        dp[p][GREATER][a[n-1]] = 1;
    } else {
        for(int x = 1;x < MAX_X;++x) {
            dp[p][GREATER][x] = 1;
        }
    }

    for(int x = 2;x < MAX_X;++x) {
        dp[p][GREATER][x] += dp[p][GREATER][x-1];
    }

    p ^= 1;
    for(int i = n-2;i >= 0;--i) {
        for(int j = 0;j<3;++j) {
            for(int k = 0;k<MAX_X;++k) {
                dp[p][j][k] = 0;
            }
        }

        for(int x = 1;x < MAX_X-1;++x) {
            if(a[i] != -1 && a[i] != x) {
                continue;
            }
            for(int state = LESS;state <= EQUAL;++state) {
                dp[p][LESS][x] += getRange(p^1, state, x+1, MAX_X-1);
                dp[p][LESS][x] %= mod;
            }
        }

        for(int x = 1;x < MAX_X;++x) {
            if(a[i] != -1 && a[i] != x) {
                continue;
            }
            for(int state = 0;state < 3;++state) {
                dp[p][EQUAL][x] += getRange(p^1, state, x, x);
                dp[p][EQUAL][x] %= mod;
            }
        }

        for(int x = 1;x < MAX_X;++x) {
            if(a[i] != -1 && a[i] != x) {
                continue;
            }
            for(int state = 0;state < 3;++state) {
                dp[p][GREATER][x] += getRange(p^1, state, 1, x-1);
                dp[p][GREATER][x] %= mod;
            }
        }

        for(int state = 0;state < 3;++state) {
            for(int x = 2;x < MAX_X;++x) {
                dp[p][state][x] = (dp[p][state][x] + dp[p][state][x-1]) % mod;
            }
        }

        p ^= 1;
    }

    p ^= 1;

    ll res = 0;

    for(int state = 0;state < 2;++state) {
        res += dp[p][state][MAX_X-1];
        res %= mod;
    }

    cout<<res<<endl;

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS 1
#pragma GCC optimize ("03")
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cmath>
#include<cstring>
#include <cstdio>
#include <stack>
#include<iomanip>
#include<queue>
#include<functional>
#include<iterator>
#include<new>
#include<cstdlib>
using namespace std;
#define INF 2000000000
const int MOD = 998244353;
#define scll(x) scanf("%lld",&x);
#define sci(x)  scanf("%d",&x);
#define scc(x)  scanf("%c", &c);
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<long long, long long> pll;

ll gcd(ll a, ll b) {
	return b == 0 ? a : gcd(b, a%b);
}

ll lcm(ll a, ll b) {
	return a*b / gcd(a, b);
}

int arr[100100];
int n, dp[100100][203][2];

int solve(int idx, int prvVal, bool satisfied) {
	if (idx == n + 1)
		return satisfied;

	int& ret = dp[idx][prvVal][satisfied];
	if (~ret)
		return ret;

	int ans = 0;
	if (arr[idx] == -1) {
		int i = (satisfied ? 1 : prvVal);
		for (; i <= 200; i++) {
			ans = (ans + solve(idx + 1, i, (i <= prvVal))) % MOD;
		}
	}
	else {
		if (!satisfied && arr[idx] < prvVal)
			return ret = 0;

		return ret = solve(idx + 1, arr[idx], arr[idx] <= prvVal);
	}
	return ret = ans;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#endif
	//cin >> n;
	scanf("%d", &n);
	arr[0] = 0;
	for (int i = 1; i <= n; ++i) {
		//cin >> arr[i];
		scanf("%d", &arr[i]);
	}
	arr[n + 1] = 0;
	//memset(dp, -1, sizeof(dp));
	//cout << solve(1, arr[0], 1) << endl;
	//printf("%d\n", solve(1, arr[0], 1));

	memset(dp, 0, sizeof(dp));
	for (int prvVal = 1; prvVal <= 200; prvVal++) {
		for (int satisfied = 1; satisfied >= 0; satisfied--) {
			dp[n + 1][prvVal][satisfied] = satisfied;
		}
	}

	for (int idx = n; idx >= 1; idx--) {
		for (int prvVal = 1; prvVal <= 200; prvVal++) {
			for (int satisfied = 1; satisfied >= 0; satisfied--) {
				dp[idx][prvVal][satisfied] = dp[idx][prvVal - 1][satisfied];
				if (arr[idx] == -1) {
					/*int i = (satisfied ? 1 : prvVal);
					for (; i <= 200; i++) {
						dp[idx][prvVal][satisfied] = (dp[idx][prvVal][satisfied] + dp[idx + 1][i][(i <= prvVal)]) % MOD;
					}*/
					dp[idx][prvVal][satisfied] = ((dp[idx][prvVal][satisfied] + dp[idx + 1][prvVal][1]) % MOD + ((dp[idx + 1][200][0] - dp[idx + 1][prvVal][0]) % MOD + MOD) % MOD) % MOD;
				}
				else {
					if (!satisfied && arr[idx] < prvVal)
						dp[idx][prvVal][satisfied] += 0;
					else
						dp[idx][prvVal][satisfied] = (dp[idx][prvVal][satisfied] + dp[idx + 1][arr[idx]][arr[idx] <= prvVal]) % MOD;
				}
			}
		}
	}
	printf("%d\n", dp[1][1][1]);

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS 1
#pragma GCC optimize ("03")
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cmath>
#include<cstring>
#include <cstdio>
#include <stack>
#include<iomanip>
#include<queue>
#include<functional>
#include<iterator>
#include<new>
#include<cstdlib>
using namespace std;
#define INF 2000000000
const int MOD = 998244353;
#define scll(x) scanf("%lld",&x);
#define sci(x)  scanf("%d",&x);
#define scc(x)  scanf("%c", &c);
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<long long, long long> pll;

ll gcd(ll a, ll b) {
	return b == 0 ? a : gcd(b, a%b);
}

ll lcm(ll a, ll b) {
	return a*b / gcd(a, b);
}

int arr[100100];
int n, dp[100100][203][2];

int solve(int idx, int prvVal, bool satisfied) {
	if (idx == n + 1)
		return satisfied;

	int& ret = dp[idx][prvVal][satisfied];
	if (~ret)
		return ret;

	int ans = 0;
	if (arr[idx] == -1) {
		int i = (satisfied ? 1 : prvVal);
		for (; i <= 200; i++) {
			ans = (ans + solve(idx + 1, i, (i <= prvVal))) % MOD;
		}
	}
	else {
		if (!satisfied && arr[idx] < prvVal)
			return ret = 0;

		return ret = solve(idx + 1, arr[idx], arr[idx] <= prvVal);
	}
	return ret = ans;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#endif
	//cin >> n;
	scanf("%d", &n);
	arr[0] = 0;
	for (int i = 1; i <= n; ++i) {
		//cin >> arr[i];
		scanf("%d", &arr[i]);
	}
	arr[n + 1] = 0;
	memset(dp, -1, sizeof(dp));
	//cout << solve(1, arr[0], 1) << endl;
	printf("%d\n", solve(1, arr[0], 1));

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS 1
#pragma GCC optimize ("03")
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cmath>
#include<cstring>
#include <cstdio>
#include <stack>
#include<iomanip>
#include<queue>
#include<functional>
#include<iterator>
#include<new>
#include<cstdlib>
using namespace std;
#define INF 2000000000
const int MOD = 998244353;
#define scll(x) scanf("%lld",&x);
#define sci(x)  scanf("%d",&x);
#define scc(x)  scanf("%c", &c);
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<long long, long long> pll;

ll gcd(ll a, ll b) {
	return b == 0 ? a : gcd(b, a%b);
}

ll lcm(ll a, ll b) {
	return a*b / gcd(a, b);
}

int arr[100100];
int n, dp[100100][203][2];

int solve(int idx, int prvVal, bool satisfied) {
	if (idx == n + 1)
		return satisfied;

	int& ret = dp[idx][prvVal][satisfied];
	if (~ret)
		return ret;

	int ans = 0;
	if (arr[idx] == -1) {
		int i = (satisfied ? 1 : prvVal);
		for (; i <= 200; i++) {
			ans = (ans + solve(idx + 1, i, (i <= prvVal))) % MOD;
		}
	}
	else {
		if (!satisfied && arr[idx] < prvVal)
			return ret = 0;

		return ret = solve(idx + 1, arr[idx], arr[idx] <= prvVal);
	}
	return ret = ans;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#endif
	//cin >> n;
	scanf("%d", &n);
	arr[0] = 0;
	for (int i = 1; i <= n; ++i) {
		//cin >> arr[i];
		scanf("%d", &arr[i]);
	}
	arr[n + 1] = 0;
	//memset(dp, -1, sizeof(dp));
	//cout << solve(1, arr[0], 1) << endl;
	//printf("%d\n", solve(1, arr[0], 1));

	memset(dp, 0, sizeof(dp));
	for (int prvVal = 1; prvVal <= 200; prvVal++) {
		for (int satisfied = 1; satisfied >= 0; satisfied--) {
			dp[n + 1][prvVal][satisfied] = satisfied + dp[n + 1][prvVal - 1][satisfied];
		}
	}

	for (int idx = n; idx >= 1; idx--) {
		for (int prvVal = 1; prvVal <= 200; prvVal++) {
			for (int satisfied = 1; satisfied >= 0; satisfied--) {
				dp[idx][prvVal][satisfied] = dp[idx][prvVal - 1][satisfied];
				if (arr[idx] == -1) {
					/*int i = (satisfied ? 1 : prvVal);
					for (; i <= 200; i++) {
						dp[idx][prvVal][satisfied] = (dp[idx][prvVal][satisfied] + dp[idx + 1][i][(i <= prvVal)]) % MOD;
					}*/
					int a = ((dp[idx + 1][prvVal][1] - (satisfied ? 0 : dp[idx + 1][prvVal - 1][1])) % MOD + MOD) % MOD;
					int b = ((dp[idx + 1][200][0] - dp[idx + 1][prvVal][0]) % MOD + MOD) % MOD;
					dp[idx][prvVal][satisfied] = ((dp[idx][prvVal][satisfied] + a) % MOD + b) % MOD;
				}
				else {
					if (!satisfied && arr[idx] < prvVal)
						dp[idx][prvVal][satisfied] += 0;
					else
						dp[idx][prvVal][satisfied] = (dp[idx][prvVal][satisfied] +
							(((dp[idx + 1][arr[idx]][arr[idx] <= prvVal]
								- dp[idx + 1][arr[idx] - 1][arr[idx] <= prvVal]) % MOD) + MOD) % MOD) % MOD;
				}
			}
		}
	}
	printf("%d\n", dp[1][1][1]);

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS 1
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cmath>
#include<cstring>
#include <cstdio>
#include <stack>
#include<iomanip>
#include<queue>
#include<functional>
#include<iterator>
#include<new>
#include<cstdlib>
using namespace std;
#define INF 2000000000
const int MOD = 998244353;
#define scll(x) scanf("%lld",&x);
#define sci(x)  scanf("%d",&x);
#define scc(x)  scanf("%c", &c);
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<long long, long long> pll;

ll gcd(ll a, ll b) {
	return b == 0 ? a : gcd(b, a%b);
}

ll lcm(ll a, ll b) {
	return a*b / gcd(a, b);
}

int arr[100100];
int n, dp[100100][203][2];

int solve(int idx, int prvVal, bool satisfied) {
	if (idx == n + 1)
		return satisfied;

	int& ret = dp[idx][prvVal][satisfied];
	if (~ret)
		return ret;

	int ans = 0;
	if (arr[idx] == -1) {
		int i = (satisfied ? 1 : prvVal);
		for (; i <= 200; i++) {
			ans = (ans + solve(idx + 1, i, (i <= prvVal))) % MOD;
		}
	}
	else {
		if (!satisfied && arr[idx] < prvVal)
			return ret = 0;

		return ret = solve(idx + 1, arr[idx], arr[idx] <= prvVal);
	}
	return ret = ans;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#endif
	//cin >> n;
	scanf("%d", &n);
	arr[0] = 0;
	for (int i = 1; i <= n; ++i) {
		//cin >> arr[i];
		scanf("%d", &arr[i]);
	}
	arr[n + 1] = 0;
	memset(dp, -1, sizeof(dp));
	//cout << solve(1, arr[0], 1) << endl;
	printf("%d\n", solve(1, arr[0], 1));

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS 1
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cmath>
#include<cstring>
#include <cstdio>
#include <stack>
#include<iomanip>
#include<queue>
#include<functional>
#include<iterator>
#include<new>
#include<cstdlib>
using namespace std;
#define INF 2000000000
const int MOD = 998244353;
#define scll(x) scanf("%lld",&x);
#define sci(x)  scanf("%d",&x);
#define scc(x)  scanf("%c", &c);
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<long long, long long> pll;

ll gcd(ll a, ll b) {
	return b == 0 ? a : gcd(b, a%b);
}

ll lcm(ll a, ll b) {
	return a*b / gcd(a, b);
}

int arr[100100];
int n, dp[100100][203][2];

int solve(int idx, int prvVal, bool satisfied) {
	if (idx == n + 1)
		return satisfied;

	int& ret = dp[idx][prvVal][satisfied];
	if (~ret)
		return ret;

	int ans = 0;
	if (arr[idx] == -1) {
		int i = (satisfied ? 1 : prvVal);
		for (; i <= 200; i++) {
			ans = (ans + solve(idx + 1, i, (i <= prvVal))) % MOD;
		}
	}
	else {
		if (!satisfied && arr[idx] < prvVal)
			return ret = 0;

		return ret = solve(idx + 1, arr[idx], arr[idx] <= prvVal);
	}
	return ret = ans;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#endif
	//cin >> n;
	scanf("%d", &n);
	arr[0] = -1;
	for (int i = 1; i <= n; ++i) {
		//cin >> arr[i];
		scanf("%d", &arr[i]);
	}
	arr[n + 1] = -1;
	memset(dp, -1, sizeof(dp));
	//cout << solve(1, arr[0], 1) << endl;
	printf("%d\n", solve(1, arr[0], 1));

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS 1
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cmath>
#include<cstring>
#include <cstdio>
#include <stack>
#include<iomanip>
#include<queue>
#include<functional>
#include<iterator>
#include<new>
#include<cstdlib>
using namespace std;
#define INF 2000000000
#define MOD 998244353
#define scll(x) scanf("%lld",&x);
#define sci(x)  scanf("%d",&x);
#define scc(x)  scanf("%c", &c);
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<long long, long long> pll;

ll gcd(ll a, ll b) {
	return b == 0 ? a : gcd(b, a%b);
}

ll lcm(ll a, ll b) {
	return a*b / gcd(a, b);
}

int arr[100100];
int n, dp[100100][203][2];

int solve(int idx, int prvVal, bool satisfied) {
	if (idx == n + 1)
		return satisfied;

	int& ret = dp[idx][prvVal][satisfied];
	int ans = 0;
	if (arr[idx] == -1) {
		int i = (satisfied ? 1 : prvVal);
		for (; i <= 200; i++) {
			ans = (ans + solve(idx + 1, i, (i <= prvVal))) % MOD;
		}
	}
	else {
		if (!satisfied && arr[idx] < prvVal)
			return ret = 0;

		return ret = solve(idx + 1, arr[idx], arr[idx] <= prvVal);
	}
	return ret = ans;
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#endif
	cin >> n;
	arr[0] = -1;
	for (int i = 1; i <= n; ++i) {
		cin >> arr[i];
	}
	arr[n + 1] = -1;
	memset(dp, -1, sizeof(dp));
	cout << solve(1, arr[0], 1) << endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define se second
#define fi first
#define pb push_back
const int N = 1e5 + 5, M = 998244353;
int dp[5][202][2][3];
// index, prev, just came, eq, dir
int v[N];
int n;

int calc(int in, int prev, bool cam, int dir) {

	if (prev > 200 || prev <= 0)
		return 0;
	if (in == n)
		return (dir != 1);
	int &ret = dp[in][prev][cam][dir];
	if (ret != -1)
		return ret;
	ret = 0;
	if (v[in] == -1) {

		// go up
		if ((prev + 1 <= 200) && (dir == 1 || dir == 2))
			ret = (ret + calc(in, prev + 1, 0, 1)) % M;

		// go down
		if (prev >= 2 && (dir == 3 || dir == 2))
			ret = (ret + calc(in, prev - 1, 0, 3)) % M;

		// equal
		if (cam) {
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		} else
			ret = (ret + calc(in + 1, prev, 1, dir)) % M;

	} else {

		if (v[in] == prev)
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		else if (v[in] < prev) {
			if (dir != 1)
				ret = (ret + calc(in + 1, v[in], 1, 3)) % M;
			else
				return ret = 0;
		} else if (v[in] > prev) {
			if (dir != 3)
				ret = (ret + calc(in + 1, v[in], 1, 1)) % M;
			else
				return ret = 0;
		}
	}

	return ret;
}

int main() {

	//freopen("in.txt", "r", stdin);

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", v + i);
	}

	//	memset(dp, -1, sizeof dp);
//	cout << calc(0, 1, 1, 1);
//	return 0;

	int dd[] = { 1, 3, 2 };

	for (int i = n; i >= 0; i--) {
		int in = i & 1, nxt = (i + 1) & 1;
		for (int cam = 0; cam <= 1; cam++) {
			for (int d = 0; d < 3; d++) {
				int dir = dd[d];
				int a, c;
				if (dir == 1 || dir == 2)
					a = 200, c = -1;
				else
					a = 1, c = 1;
				for (int prev = a; prev <= 200 && prev >= 1; prev += c) {
					int &ret = dp[in][prev][cam][dir];
					if (i == n) {
						ret = (dir != 1);
						continue;
					}
					ret = 0;
					if (v[i] == -1) {
						// go up
						if ((prev + 1 <= 200) && (dir == 1 || dir == 2))
							ret = (ret + dp[in][prev + 1][0][1]) % M;

						// go down
						if (prev >= 2 && (dir == 3 || dir == 2))
							ret = (ret + dp[in][prev - 1][0][3]) % M;

						// equal
						if (cam) {
							ret = (ret + dp[nxt][prev][1][2]) % M;
						} else
							ret = (ret + dp[nxt][prev][1][dir]) % M;

					} else {

						if (v[i] == prev)
							ret = (ret + dp[nxt][prev][1][2]) % M;
						else if (v[i] < prev) {
							if (dir != 1)
								ret = (ret + dp[nxt][v[i]][1][3]) % M;
							else
								ret = 0;
						} else if (v[i] > prev) {
							if (dir != 3)
								ret = (ret + dp[nxt][v[i]][1][1]) % M;
							else
								ret = 0;
						}
					}
				}
			}
		}
	}

	printf("%d\n", dp[0][1][1][1]);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define se second
#define fi first
#define pb push_back
const int N = 1e5 + 5, M = 998244353;
int dp[5][202][2][3];
// index, prev, just came, eq, dir
int v[N];
int n;

int calc(int in, int prev, bool cam, int dir) {

	if (prev > 200 || prev <= 0)
		return 0;
	if (in == n)
		return (dir != 1);
	int &ret = dp[in][prev][cam][dir];
	if (ret != -1)
		return ret;
	ret = 0;
	if (v[in] == -1) {

		// go up
		if ((prev + 1 <= 200) && (dir == 1 || dir == 2))
			ret = (ret + calc(in, prev + 1, 0, 1)) % M;

		// go down
		if (prev >= 2 && (dir == 3 || dir == 2))
			ret = (ret + calc(in, prev - 1, 0, 3)) % M;

		// equal
		if (cam) {
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		} else
			ret = (ret + calc(in + 1, prev, 1, dir)) % M;

	} else {

		if (v[in] == prev)
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		else if (v[in] < prev) {
			if (dir != 1)
				ret = (ret + calc(in + 1, v[in], 1, 3)) % M;
			else
				return ret = 0;
		} else if (v[in] > prev) {
			if (dir != 3)
				ret = (ret + calc(in + 1, v[in], 1, 1)) % M;
			else
				return ret = 0;
		}
	}

	return ret;
}

int main() {

	//freopen("in.txt", "r", stdin);

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", v + i);
	}
	if (n == 1) {
		if (v[0] != -1)
			puts("1");
		else
			puts("200");
		return 0;
	}
//	memset(dp, -1, sizeof dp);
//	cout << calc(0, 1, 1, 1);
//	return 0;

	int dd[] = { 1, 3, 2 };

	for (int i = n; i >= 0; i--) {
		int in = i & 1, nxt = (i + 1) & 1;
		for (int cam = 0; cam <= 1; cam++) {
			for (int d = 0; d < 3; d++) {
				int dir = dd[d];
				for (int prev = 200; prev >= 1; prev--) {
					int &ret = dp[in][prev][cam][dir];
					if (i == n) {
						ret = (dir != 1);
						continue;
					}
					ret = 0;
					if (v[i] == -1) {
						// go up
						if ((prev + 1 <= 200) && (dir == 1 || dir == 2))
							ret = (ret + dp[in][prev + 1][0][1]) % M;

						// go down
						if (prev >= 2 && (dir == 3 || dir == 2))
							ret = (ret + dp[in][prev - 1][0][3]) % M;

						// equal
						if (cam) {
							ret = (ret + dp[nxt][prev][1][2]) % M;
						} else
							ret = (ret + dp[nxt][prev][1][dir]) % M;

					} else {

						if (v[i] == prev)
							ret = (ret + dp[nxt][prev][1][2]) % M;
						else if (v[i] < prev) {
							if (dir != 1)
								ret = (ret + dp[nxt][v[i]][1][3]) % M;
							else
								ret = 0;
						} else if (v[i] > prev) {
							if (dir != 3)
								ret = (ret + dp[nxt][v[i]][1][1]) % M;
							else
								ret = 0;
						}
					}
				}
			}
		}
	}

	printf("%d\n", dp[0][1][1][1]);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define se second
#define fi first
#define pb push_back
const int N = 1e5 + 5, M = 998244353;
int dp[5][202][2][3];
// index, prev, just came, eq, dir
int v[N];
int n;

int calc(int in, int prev, bool cam, int dir) {

	if (prev > 200 || prev <= 0)
		return 0;
	if (in == n)
		return (dir != 1);
	int &ret = dp[in][prev][cam][dir];
	if (ret != -1)
		return ret;
	ret = 0;
	if (v[in] == -1) {

		// go up
		if ((prev + 1 <= 200) && (dir == 1 || dir == 2))
			ret = (ret + calc(in, prev + 1, 0, 1)) % M;

		// go down
		if (prev >= 2 && (dir == 3 || dir == 2))
			ret = (ret + calc(in, prev - 1, 0, 3)) % M;

		// equal
		if (cam) {
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		} else
			ret = (ret + calc(in + 1, prev, 1, dir)) % M;

	} else {

		if (v[in] == prev)
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		else if (v[in] < prev) {
			if (dir != 1)
				ret = (ret + calc(in + 1, v[in], 1, 3)) % M;
			else
				return ret = 0;
		} else if (v[in] > prev) {
			if (dir != 3)
				ret = (ret + calc(in + 1, v[in], 1, 1)) % M;
			else
				return ret = 0;
		}
	}

	return ret;
}

int main() {

	//freopen("in.txt", "r", stdin);

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", v + i);
	}

	//	memset(dp, -1, sizeof dp);
//	cout << calc(0, 1, 1, 1);
//	return 0;

	int dd[] = { 1, 3, 2 };
	int end = 0;
	if (v[0] != -1)
		end = 1;

	for (int i = n; i >= end; i--) {
		int in = i & 1, nxt = (i + 1) & 1;
		for (int cam = 0; cam <= 1; cam++) {
			for (int d = 0; d < 3; d++) {
				int dir = dd[d];
				for (int prev = 200; prev >= 1; prev--) {
					int &ret = dp[in][prev][cam][dir];
					if (i == n) {
						ret = (dir != 1);
						continue;
					}
					ret = 0;
					if (v[i] == -1) {
						// go up
						if ((prev + 1 <= 200) && (dir == 1 || dir == 2))
							ret = (ret + dp[in][prev + 1][0][1]) % M;

						// go down
						if (prev >= 2 && (dir == 3 || dir == 2))
							ret = (ret + dp[in][prev - 1][0][3]) % M;

						// equal
						if (cam) {
							ret = (ret + dp[nxt][prev][1][2]) % M;
						} else
							ret = (ret + dp[nxt][prev][1][dir]) % M;

					} else {

						if (v[i] == prev)
							ret = (ret + dp[nxt][prev][1][2]) % M;
						else if (v[i] < prev) {
							if (dir != 1)
								ret = (ret + dp[nxt][v[i]][1][3]) % M;
							else
								ret = 0;
						} else if (v[i] > prev) {
							if (dir != 3)
								ret = (ret + dp[nxt][v[i]][1][1]) % M;
							else
								ret = 0;
						}
					}
				}
			}
		}
	}
	if (v[0] == -1)
		printf("%d\n", dp[0][1][1][1]);
	else
		printf("%d\n", dp[1][v[0]][1][1]);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define se second
#define fi first
#define pb push_back
const int N = 1e5 + 5, M = 998244353;
int dp[5][202][2][3];
// index, prev, just came, dir
int v[N];
int n;

int main() {

	//freopen("in.txt", "r", stdin);

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", v + i);
	}

	int dd[] = { 1, 3, 2 };

	for (int i = n; i >= 0; i--) {
		int in = i & 1, nxt = (i + 1) & 1;
		for (int cam = 0; cam <= 1; cam++) {
			for (int d = 0; d < 3; d++) {
				int dir = dd[d];
				int a, c;
				if (dir == 1 || dir == 2)
					a = 200, c = -1;
				else
					a = 1, c = 1;
				for (int prev = a; prev <= 200 && prev >= 1; prev += c) {
					int &ret = dp[in][prev][cam][dir];
					if (i == n) {
						ret = (dir != 1);
						continue;
					}
					ret = 0;
					if (v[i] == -1) {
						// go up
                              if (prev <200 && (dir == 1 || cam))
							ret = (ret + dp[in][prev + 1][0][1]) % M;

						// go down
						if (prev >= 2 && (dir == 3 || dir == 2))
							ret = (ret + dp[in][prev - 1][0][3]) % M;

						// equal
						if (cam) {
							ret = (ret + dp[nxt][prev][1][2]) % M;
						} else
							ret = (ret + dp[nxt][prev][1][dir]) % M;

					} else {

						if (v[i] == prev)
							ret = (ret + dp[nxt][prev][1][2]) % M;
						else if (v[i] < prev) {
							if (dir != 1)
								ret = (ret + dp[nxt][v[i]][1][3]) % M;
							else
								ret = 0;
						} else if (v[i] > prev) {
								ret = (ret + dp[nxt][v[i]][1][1]) % M;
						}
					}
				}
			}
		}
	}

	printf("%d\n", dp[0][1][1][1]);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define se second
#define fi first
#define pb push_back
const int N = 1e5 + 5, M = 998244353;
int dp[5][202][2][3];
// index, prev, just came, eq, dir
int v[N];
int n;

int calc(int in, int prev, bool cam, int dir) {

	if (prev > 200 || prev <= 0)
		return 0;
	if (in == n)
		return (dir != 1);
	int &ret = dp[in][prev][cam][dir];
	if (ret != -1)
		return ret;
	ret = 0;
	if (v[in] == -1) {

		// go up
		if ((prev + 1 <= 200) && (dir == 1 || dir == 2))
			ret = (ret + calc(in, prev + 1, 0, 1)) % M;

		// go down
		if (prev >= 2 && (dir == 3 || dir == 2))
			ret = (ret + calc(in, prev - 1, 0, 3)) % M;

		// equal
		if (cam) {
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		} else
			ret = (ret + calc(in + 1, prev, 1, dir)) % M;

	} else {

		if (v[in] == prev)
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		else if (v[in] < prev) {
			if (dir != 1)
				ret = (ret + calc(in + 1, v[in], 1, 3)) % M;
			else
				return ret = 0;
		} else if (v[in] > prev) {
			if (dir != 3)
				ret = (ret + calc(in + 1, v[in], 1, 1)) % M;
			else
				return ret = 0;
		}
	}

	return ret;
}

int main() {

	//freopen("in.txt", "r", stdin);

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", v + i);
	}
//	memset(dp, -1, sizeof dp);
//	cout << calc(0, 1, 1, 1);
//	return 0;

	int dd[] = { 1, 3, 2 };

	for (int i = n; i >= 0; i--) {
		int in = i & 1, nxt = (i + 1) & 1;
		for (int cam = 0; cam <= 1; cam++) {
			for (int d = 0; d < 3; d++) {
				int dir = dd[d];
				for (int prev = 200; prev >= 1; prev--) {
					int &ret = dp[in][prev][cam][dir];
					if (i == n) {
						ret = (dir != 1);
						continue;
					}
					ret = 0;
					if (v[i] == -1) {
						// go up
						if ((prev + 1 <= 200) && (dir == 1 || dir == 2))
							ret = (ret + dp[in][prev + 1][0][1]) % M;

						// go down
						if (prev >= 2 && (dir == 3 || dir == 2))
							ret = (ret + dp[in][prev - 1][0][3]) % M;

						// equal
						if (cam) {
							ret = (ret + dp[nxt][prev][1][2]) % M;
						} else
							ret = (ret + dp[nxt][prev][1][dir]) % M;

					} else {

						if (v[i] == prev)
							ret = (ret + dp[nxt][prev][1][2]) % M;
						else if (v[i] < prev) {
							if (dir != 1)
								ret = (ret + dp[nxt][v[i]][1][3]) % M;
							else
								ret = 0;
						} else if (v[i] > prev) {
							if (dir != 3)
								ret = (ret + dp[nxt][v[i]][1][1]) % M;
							else
								ret = 0;
						}
					}
				}
			}
		}
	}

	printf("%d\n", dp[0][1][1][1]);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define se second
#define fi first
#define pb push_back
const int N = 1e5 + 1, M = 998244353;
int dp[N][202][2][3];
// index, prev, just came, eq, dir
int v[N];
int n;

int calc(int in, int prev, bool cam, int dir) {

	if (prev > 200 || prev <= 0)
		return 0;
	if (in == n)
		return (dir != 1);
	int &ret = dp[in][prev][cam][dir];
	if (ret != -1)
		return ret;
	ret = 0;
	if (v[in] == -1) {

		// go up
		ret = (ret + calc(in, prev + 1, 0, 1)) % M;

		// go down
		if (prev >= 2 && (dir == 3 || dir == 2))
			ret = (ret + calc(in, prev - 1, 0, 3)) % M;

		// equal
		if (cam) {
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		} else
			ret = (ret + calc(in + 1, prev, 1, dir)) % M;

	} else {

		if (v[in] == prev)
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		else if (v[in] < prev) {
			if (dir != 1)
				ret = (ret + calc(in + 1, v[in], 1, 3)) % M;
			else
				return ret = 0;
		} else if (v[in] > prev) {
				ret = (ret + calc(in + 1, v[in], 1, 1)) % M;
		}
	}

	return ret;
}

int main() {

	//	freopen("in.txt", "r", stdin);

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", v + i);
	}
	memset(dp, -1, sizeof dp);
	for (int i = n; i >= 0; i--) {
		calc(i, 100, 0, 1);
		calc(i, 100, 0, 3);
		calc(i, 100, 0, 2);
	}
	cout << calc(0, 1, 1, 1);
	return 0;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define se second
#define fi first
#define pb push_back
const int N = 1e5 + 1, M = 998244353;
int dp[N][202][2][3];
// index, prev, just came, eq, dir
int v[N];
int n;

int calc(int in, int prev, bool cam, int dir) {

	if (prev > 200 || prev <= 0)
		return 0;
	if (in == n)
		return (dir != 1);
	int &ret = dp[in][prev][cam][dir];
	if (ret != -1)
		return ret;
	ret = 0;
	if (v[in] == -1) {

		// go up
		if ((prev + 1 <= 200) && (dir == 1 || dir == 2))
			ret = (ret + calc(in, prev + 1, 0, 1)) % M;

		// go down
		if (prev >= 2 && (dir == 3 || dir == 2))
			ret = (ret + calc(in, prev - 1, 0, 3)) % M;

		// equal
		if (cam) {
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		} else
			ret = (ret + calc(in + 1, prev, 1, dir)) % M;

	} else {

		if (v[in] == prev)
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		else if (v[in] < prev) {
			if (dir != 1)
				ret = (ret + calc(in + 1, v[in], 1, 3)) % M;
			else
				return ret = 0;
		} else if (v[in] > prev) {
			if (dir != 3)
				ret = (ret + calc(in + 1, v[in], 1, 1)) % M;
			else
				return ret = 0;
		}
	}

	return ret;
}

int main() {

	//	freopen("in.txt", "r", stdin);

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", v + i);
	}
	memset(dp, -1, sizeof dp);
	for (int i = n; i >= 0; i--) {
		calc(i, 100, 0, 1);
		calc(i, 100, 0, 3);
		calc(i, 100, 0, 2);
	}
	cout << calc(0, 1, 1, 1);
	return 0;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define se second
#define fi first
#define pb push_back
const int N = 1e5 + 5, M = 998244353;
int dp[5][202][2][3];
// index, prev, just came, eq, dir
int v[N];
int n;

int calc(int in, int prev, bool cam, int dir) {

	if (prev > 200 || prev <= 0)
		return 0;
	if (in == n)
		return (dir != 1);
	int &ret = dp[in][prev][cam][dir];
	if (ret != -1)
		return ret;
	ret = 0;
	if (v[in] == -1) {

		// go up
		if ((prev + 1 <= 200) && (dir == 1 || dir == 2))
			ret = (ret + calc(in, prev + 1, 0, 1)) % M;

		// go down
		if (prev >= 2 && (dir == 3 || dir == 2))
			ret = (ret + calc(in, prev - 1, 0, 3)) % M;

		// equal
		if (cam) {
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		} else
			ret = (ret + calc(in + 1, prev, 1, dir)) % M;

	} else {

		if (v[in] == prev)
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		else if (v[in] < prev) {
			if (dir != 1)
				ret = (ret + calc(in + 1, v[in], 1, 3)) % M;
			else
				return ret = 0;
		} else if (v[in] > prev) {
			if (dir != 3)
				ret = (ret + calc(in + 1, v[in], 1, 1)) % M;
			else
				return ret = 0;
		}
	}

	return ret;
}

int main() {

	//	freopen("in.txt", "r", stdin);

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", v + i);
	}
	memset(dp, -1, sizeof dp);
	for (int i = n; i >= 0; i--) {
		calc(i, 100, 0, 1);
		calc(i, 100, 0, 3);
		calc(i, 100, 0, 2);
	}
	cout << calc(0, 1, 1, 1);
	return 0;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define se second
#define fi first
#define pb push_back
const int N = 1e5 + 1, M = 998244353;
int dp[N][202][2][3];
// index, prev, just came, eq, dir
int v[N];
int n;

int calc(int in, int prev, bool cam, int dir) {

	if (prev > 200 || prev <= 0)
		return 0;
	if (in == n)
		return (dir != 1);
	int &ret = dp[in][prev][cam][dir];
	if (ret != -1)
		return ret;
	ret = 0;
	if (v[in] == -1) {

		// go up
    if (dir == 1 || cam)
		ret = (ret + calc(in, prev + 1, 0, 1)) % M;

		// go down
		if (prev >= 2 && (dir !=1))
			ret = (ret + calc(in, prev - 1, 0, 3)) % M;

		// equal
		if (cam) {
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		} else
			ret = (ret + calc(in + 1, prev, 1, dir)) % M;

	} else {

		if (v[in] == prev)
			ret = (ret + calc(in + 1, prev, 1, 2)) % M;
		else if (v[in] < prev) {
			if (dir != 1)
				ret = (ret + calc(in + 1, v[in], 1, 3)) % M;
			else
				return ret = 0;
		} else if (v[in] > prev) {
				ret = (ret + calc(in + 1, v[in], 1, 1)) % M;
		}
	}

	return ret;
}

int main() {

	//	freopen("in.txt", "r", stdin);

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", v + i);
	}
	memset(dp, -1, sizeof dp);
	for (int i = n; i >= 0; i--) {
		calc(i, 100, 0, 1);
		calc(i, 100, 0, 3);
		calc(i, 100, 0, 2);
	}
	cout << calc(0, 1, 1, 1);
	return 0;

	return 0;
}


#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long lli;
typedef long double ld;
const double E = 0.0000001;
const int INF = 1e7;
#define forn(i, s, f) for (int i = s; i < f; ++i)
#define ft first
#define sec second
#define fora(i, n) for (auto i : n)
#define sz(a) (int)(a).size()
#define sortf0rw(a) sort(a.begin(), a.end())
#define pb push_back
#define mp make_pair
#define fast_ cin.tie(0), ios_base::sync_with_stdio(false);
// ____________________________________________________________

int main() {
    lli mod = 998244353;
    int n;
    int maxn = 201;
    cin >> n;
    vector<int> a(n);
    forn(i, 0, n) cin >> a[i];
    vector<vector<vector<lli> > > dp(n, vector<vector<lli> > (maxn, vector<lli> (3, 0)));
    if (a[0] == -1) {
        forn(num, 1, maxn)
            dp[0][num][0] = 1;
    } else {
        dp[0][a[0]][0] = 1;
    }
    forn(i, 1, n) {
        if (a[i] == -1) {
            forn(num, 2, maxn) {
                dp[i][num][0] = (dp[i][num - 1][0] + (dp[i - 1][num - 1][0] +
                    dp[i - 1][num - 1][1] + dp[i - 1][num - 1][2]) % mod) % mod;
            }
            forn(num, 1, maxn) {
                dp[i][num][1] = (dp[i - 1][num][0] + dp[i - 1][num][1] + dp[i - 1][num][2]) % mod;
            }
            for (int num = maxn - 2; num >= 0; --num) {
                dp[i][num][2] = (dp[i][num + 1][2] + (dp[i - 1][num + 1][1] + dp[i - 1][num + 1][2]) % mod) % mod;
            }
        } else {
            forn(num, 1, a[i]) {
                dp[i][a[i]][0] = (dp[i - 1][num][0] + dp[i - 1][num][1] + dp[i - 1][num][2]) % mod;
            }
            dp[i][a[i]][1] = (dp[i - 1][a[i]][0] + dp[i - 1][a[i]][1] + dp[i - 1][a[i]][2]) % mod;
            forn(num, a[i] + 1, maxn) {
                dp[i][a[i]][2] = (dp[i - 1][num][1] + dp[i - 1][num][2]) % mod;
            }
        }
    }
    lli ans = 0;
    forn(num, 1, maxn) {
        ans = (ans + dp[n - 1][num][1] + dp[n - 1][num][2]) % mod;
    }
    cout << ans << '\n';
    return 0;

}


#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long lli;
typedef long double ld;
const double E = 0.0000001;
const int INF = 1e7;
#define forn(i, s, f) for (int i = s; i < f; ++i)
#define ft first
#define sec second
#define fora(i, n) for (auto i : n)
#define sz(a) (int)(a).size()
#define sortf0rw(a) sort(a.begin(), a.end())
#define pb push_back
#define mp make_pair
#define fast_ cin.tie(0), ios_base::sync_with_stdio(false);
// ____________________________________________________________

int main() {
    lli mod = 998244353;
    int n;
    int maxn = 201;
    cin >> n;
    vector<int> a(n);
    forn(i, 0, n) cin >> a[i];
    vector<vector<vector<long> > > dp(n, vector<vector<long> > (maxn, vector<long> (3, 0)));
    if (a[0] == -1) {
        forn(num, 1, maxn)
            dp[0][num][0] = 1;
    } else {
        dp[0][a[0]][0] = 1;
    }
    forn(i, 1, n) {
        if (a[i] == -1) {
            forn(num, 2, maxn) {
                dp[i][num][0] = (dp[i][num - 1][0] + (dp[i - 1][num - 1][0] +
                    dp[i - 1][num - 1][1] + dp[i - 1][num - 1][2]) % mod) % mod;
            }
            forn(num, 1, maxn) {
                dp[i][num][1] = (dp[i - 1][num][0] + dp[i - 1][num][1] + dp[i - 1][num][2]) % mod;
            }
            for (int num = maxn - 2; num >= 0; --num) {
                dp[i][num][2] = (dp[i][num + 1][2] + (dp[i - 1][num + 1][1] + dp[i - 1][num + 1][2]) % mod) % mod;
            }
        } else {
            forn(num, 1, a[i]) {
                dp[i][a[i]][0] = (dp[i - 1][num][0] + dp[i - 1][num][1] + dp[i - 1][num][2]) % mod;
            }
            dp[i][a[i]][1] = (dp[i - 1][a[i]][0] + dp[i - 1][a[i]][1] + dp[i - 1][a[i]][2]) % mod;
            forn(num, a[i] + 1, maxn) {
                dp[i][a[i]][2] = (dp[i - 1][num][1] + dp[i - 1][num][2]) % mod;
            }
        }
    }
    lli ans = 0;
    forn(num, 1, maxn) {
        ans = (ans + dp[n - 1][num][1] + dp[n - 1][num][2]) % mod;
    }
    cout << ans << '\n';
    return 0;

}


#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long lli;
typedef long double ld;
const double E = 0.0000001;
const int INF = 1e7;
#define forn(i, s, f) for (int i = s; i < f; ++i)
#define ft first
#define sec second
#define fora(i, n) for (auto i : n)
#define sz(a) (int)(a).size()
#define sortf0rw(a) sort(a.begin(), a.end())
#define pb push_back
#define mp make_pair
#define fast_ cin.tie(0), ios_base::sync_with_stdio(false);
// ____________________________________________________________

int main() {
    lli mod = 998244353;
    int n;
    int maxn = 201;
    cin >> n;
    vector<int> a(n);
    forn(i, 0, n) cin >> a[i];
    //vector<vector<vector<long> > > dp(n, vector<vector<long> > (maxn, vector<long> (3, 0)));
    vector<vector<lli> > d(maxn, vector<lli> (3, 0)), p(maxn, vector<lli> (3, 0));

    if (a[0] == -1) {
        forn(num, 1, maxn) {
            p[num][0] = 1;
        }
    } else {
        p[a[0]][0] = 1;
    }
    forn(i, 1, n) {
        d = p;
        p.assign(maxn, vector<lli> (3, 0));
        /*forn(num, 1, maxn) {
            cout << d[num][0] << " " << d[num][1] << " " << d[num][2] << " || ";
        } cout << '\n'; */

        if (a[i] == -1) {
            forn(num, 2, maxn) {
                p[num][0] = (p[num - 1][0] + (d[num - 1][0] + d[num - 1][1] + d[num - 1][2]) % mod) % mod;
            }
            forn(num, 1, maxn) {
                p[num][1] = (d[num][0] + d[num][1] + d[num][2]) % mod;
            }
            for (int num = maxn - 2; num >= 0; --num) {
                p[num][2] = (p[num + 1][2] + (d[num + 1][1] + d[num + 1][2]) % mod) % mod;
            }
        } else {
            forn(num, 1, a[i]) {
                p[a[i]][0] = (d[num][0] + d[num][1] + d[num][2]) % mod;
            }
            p[a[i]][1] = (d[a[i]][0] + d[a[i]][1] + d[a[i]][2]) % mod;
            forn(num, a[i] + 1, maxn) {
                p[a[i]][2] = (d[num][1] + d[num][2]) % mod;
            }
        }
    }
    lli ans = 0;
    forn(num, 1, maxn) {
        ans = (ans + p[num][1] + p[num][2]) % mod;
    }
    cout << ans << '\n';

    /*if (a[0] == -1) {
        forn(num, 1, maxn)
            dp[0][num][0] = 1;
    } else {
        dp[0][a[0]][0] = 1;
    }
    forn(i, 1, n) {
        if (a[i] == -1) {
            forn(num, 2, maxn) {
                dp[i][num][0] = (dp[i][num - 1][0] + (dp[i - 1][num - 1][0] +
                    dp[i - 1][num - 1][1] + dp[i - 1][num - 1][2]) % mod) % mod;
            }
            forn(num, 1, maxn) {
                dp[i][num][1] = (dp[i - 1][num][0] + dp[i - 1][num][1] + dp[i - 1][num][2]) % mod;
            }
            for (int num = maxn - 2; num >= 0; --num) {
                dp[i][num][2] = (dp[i][num + 1][2] + (dp[i - 1][num + 1][1] + dp[i - 1][num + 1][2]) % mod) % mod;
            }
        } else {
            forn(num, 1, a[i]) {
                dp[i][a[i]][0] = (dp[i - 1][num][0] + dp[i - 1][num][1] + dp[i - 1][num][2]) % mod;
            }
            dp[i][a[i]][1] = (dp[i - 1][a[i]][0] + dp[i - 1][a[i]][1] + dp[i - 1][a[i]][2]) % mod;
            forn(num, a[i] + 1, maxn) {
                dp[i][a[i]][2] = (dp[i - 1][num][1] + dp[i - 1][num][2]) % mod;
            }
        }
    }
    lli ans = 0;
    forn(num, 1, maxn) {
        ans = (ans + dp[n - 1][num][1] + dp[n - 1][num][2]) % mod;
    }
    cout << ans << '\n';*/
    return 0;

}