Get inspector element using c#

From my main camera I need to get element 2 from script Location in which the results would be 3.

I tried this code which didn’t work

print(Camera.main.GetComponent<Location>().location.element2);

In the inspector I have

Location (Script)

Location

Size 4
Element 0           4
Element 1           1
Element 2           3
Element 3           0

Assuming location is a array, use .location[2] instead of .location.element2