// Arup Guha
// 3/15/2018
// Solution to 2018 Feb USACO Gold Problem: Taming the Herd

import java.util.*;
import java.io.*;

public class taming {

	public static int n;
	public static int[] list;
	public static int[][] wrong;

	public static void main(String[] args) throws Exception {

		// Get numbers.
		Scanner stdin = new Scanner(new File("taming.in"));
		int n = stdin.nextInt();
		list = new int[n];
		for (int i=0; i<n; i++)
			list[i] = stdin.nextInt();

		// Pre-comp how many are wrong if index i to j
		// represents a streak 0, 1, 2, ..., j-i.
		wrong = new int[n][n];
		for (int i=0; i<n; i++) {

			// At first nothing is wrong.
			int cnt = 0;

			// If this item is wrong, add 1 to cnt and record for this streak.
			for (int j=i; j<n; j++) {
				if (j-i != list[j]) cnt++;
				wrong[i][j] = cnt;
			}
		}

		// dp[i] stores all answers for i+1 breakouts.
		// dp[i][j] is best answer for i+1 breakouts for the first j+1 days.
		int[][] dp = new int[n][n];

		// We already calculated this.
		dp[0] = Arrays.copyOf(wrong[0], n);

		// Build answer for i+1 breakouts from answers for i breakouts.
		for (int i=1; i<n; i++) {

			// Only way to do this.
			dp[i][i] = dp[i-1][i-1] + wrong[i][i];

			// Now work through different values of j.
			for (int j=i+1; j<n; j++) {

				// Last streak if of length 1.
				dp[i][j] = dp[i-1][j-1] + wrong[j][j];

				// Try all splits for last segment.
				for (int k=i-1; k<j; k++)
					dp[i][j] = Math.min(dp[i][j], dp[i-1][k] + wrong[k+1][j]);
			}
		}

		// Output all relevant results.
		PrintWriter out = new PrintWriter(new FileWriter("taming.out"));
		for (int i=0; i<n; i++)
			out.println(dp[i][n-1]);
		out.close();
	}
}
