# add you code here
import sys
x = []
for i in sys.stdin:
    x.append(i.strip().split())
T = int(x[0][0])
p = []
cars = x[1]
for i in range(len(cars)):
    cars[i] = int(cars[i])
    p.append(i)

for i in range(len(cars)):
    p[i] = p[i] + cars[i]*T
	
passed = 0
for j in range(len(p)-1):
    for k in range(j, len(p)):
        if p[j] > p[k]:
            passed = passed + 1
print(passed)
a1e1e22a4422b7770fc66e0e40702e2a98d9dac2
<mask token>

<mask token>
for i in sys.stdin:
    x.append(i.strip().split())
<mask token>
for i in range(len(cars)):
    cars[i] = int(cars[i])
    p.append(i)
for i in range(len(cars)):
    p[i] = p[i] + cars[i] * T
<mask token>
for j in range(len(p) - 1):
    for k in range(j, len(p)):
        if p[j] > p[k]:
            passed = passed + 1
print(passed)

<mask token>
x = []
for i in sys.stdin:
    x.append(i.strip().split())
T = int(x[0][0])
p = []
cars = x[1]
for i in range(len(cars)):
    cars[i] = int(cars[i])
    p.append(i)
for i in range(len(cars)):
    p[i] = p[i] + cars[i] * T
passed = 0
for j in range(len(p) - 1):
    for k in range(j, len(p)):
        if p[j] > p[k]:
            passed = passed + 1
print(passed)

import sys
x = []
for i in sys.stdin:
    x.append(i.strip().split())
T = int(x[0][0])
p = []
cars = x[1]
for i in range(len(cars)):
    cars[i] = int(cars[i])
    p.append(i)
for i in range(len(cars)):
    p[i] = p[i] + cars[i] * T
passed = 0
for j in range(len(p) - 1):
    for k in range(j, len(p)):
        if p[j] > p[k]:
            passed = passed + 1
print(passed)

# add you code here
import sys
x = []
for i in sys.stdin:
    x.append(i.strip().split())
T = int(x[0][0])
p = []
cars = x[1]
for i in range(len(cars)):
    cars[i] = int(cars[i])
    p.append(i)

for i in range(len(cars)):
    p[i] = p[i] + cars[i]*T
	
passed = 0
for j in range(len(p)-1):
    for k in range(j, len(p)):
        if p[j] > p[k]:
            passed = passed + 1
print(passed)