Create a program for counting the number of elements present in a user-provided array using Python.
user_array = [1, 5, 15, 20]
def count_elements(array):
    count = 0
    for item in array:
        count += 1
    return count

user_array = [1, 5, 15, 20]
result = count_elements(user_array)
print(result) # 4