Optimal character recognition