I would take a somewhat flexible tape measure and secure it to the boat (with duct tape of course) and follow the rubrail around to the stern taping it in place every few feet and then 1/2 way across the stern to get a more accurate number. Your total length required will be 2X of what you measured.
Take a string and attack one end at the start of the rub-rail channel, and pull it to the other rub-rail end. Then measure that string and double it for both sides. And then make absolute sure you are correct in that measurement. Adding extra is really a good thing to do. Especially if there are any curves. Then go shopping for the insert.
Insert does get expensive indeed. I just finished buying and inserting rub-rail insert on my boat. I used Wefco Rubber Inc in California. They have virtually every type insert you can want. And they did match mine perfectly too. JMHO