O scale is 1:48. Easier calculation is this. Divide the prototype size by 48.
Since you probably want to know the length of the model in inches, you can first multiply the prototype size by 12 and then divide by 48.
So a 50-foot boxcar is 12.5 inches (50 times 12 divided by 48).