Performing arithmetic on user input