AC. had to convert result to int to get a working solution