integer_array = []

with open('IntegerArray.txt') as f:
    for line in f:
        integer_array.append(int(line))

inversions = 0

for i in range(len(integer_array) - 1):
    for j in range(i + 1, len(integer_array)):
        if integer_array[i] > integer_array[j]:
            inversions += 1

print(inversions)  # 2407905288