should return 6 if string is 1,2,3