Length calculator by ruby