I made a program where the user enters a number, and the program would count up to that number and display how much time it took. However, whenever I enter letters or decimals (i.e. 0.5), I would get a error. Here is the full error message:

```
Traceback (most recent call last):
  File "C:\Documents and Settings\Username\Desktop\test6.py", line 5, in <module>
    z = int(z)
ValueError: invalid literal for int() with base 10: 'df'

```

What can I do to fix this?

Here is the full code:

```
import time
x = 0
print("This program will count up to a number you choose.")
z = input("Enter a number.\n")
z = int(z)
start_time = time.time()
while x < z:
    x = x + 1
    print(x)
end_time = time.time()
diff = end_time - start_time
print("That took",(diff),"seconds.")

```

Please help!