One way to figure out chain length is to count the teeth on the sprockets. As in 17/34. Now divide both by 2, as in 8.5/17.
Now measure from the center of the rear sprocket to the center of the front sprocket. Let say 29 inches. You need to double this, so 58. Now the chain has 5/8 inch long links so 5/8 = .625 so 58 divided by .625 is 92.8 That's how may links is in 58 inches. Add the links from before. 92.8+8.5+17=118.3 links. Your center to center length may be different so measure and use your measurement.
Buy a chain the next length longer than this figure and cut off extra to fit.
Leo