Solve problem 56 using Rust.