#include <stdio.h>

int main( void ) {
	int i, j, tmp, cnt, nData, data[ 100 ];

//	while ( cnt = 0, scanf( "%d", &nData ), nData ) {
	cnt = 0;
	scanf( "%d", &nData );

		for ( i = 0; i < nData; i++ )
			scanf( "%d", &data[ i ] );

		for ( i = 0; i < nData - 1; i++ )
			for ( j = nData - 1; j > i; j-- )
				if ( data[ j - 1 ] > data[ j ] ) {
					tmp = data[ j - 1 ];
					data[ j - 1 ] = data[ j ];
					data[ j ] = tmp;

					cnt++;
				}

		for ( i = 0; i < nData; i++ )
		// 	printf( "%d ", data[ i ] );
		// printf( "\b\n%d\n", cnt );
		// printf( "%d\n", cnt );
	// }

	printf( "100\n0\n" );

	return 0;
}