If the perimeter of an isosceles triangle with integral sides is 2017, how many different lengths are possible for the legs