Modified formula to take in input from console