A surface treating agent comprising a copolymer including: a monomer (A) having a hydrophilic functional group of formula (1), a monomer (B) having a basic functional group of formula (3) or (5), and a monomer (C) having a reactive functional group of formula (7), wherein the copolymer has a molar ratio of the monomer (A)/the monomer (B)/and the monomer (C) between 87/10/3 and 98/1/1. In the formulas, the R groups and n are defined.