using System; using System.Linq;//リストの使用 using System.Collections.Generic; using System.Text;//テキストの高速出力に必要 class Program { static void Main() { long n = long.Parse(Console.ReadLine());//long.Parseはstringをlongに変換。 long answer = 0; long[] positions = new long[n]; for(int i = 0; i < n; i++) { positions[i] = long.Parse(Console.ReadLine()); for(int j = 0; j < i; j++) { if(positions[j] >= positions[i]) answer++; } } Console.WriteLine(answer); } }