We solved the Frenkel-Kontorova model with the potential V(u) = -λ(u - Int[u] -1/2)2/2 exactly. The minimum energy configurations and recurrent configurations with fixed winding number are completely characterized. The average energy per atom of different configurations are explicitly calculated, which is used to determine the ground state configuration with a given winding number. The evolution of the ground state configurations is shown to be dictated by the Farey fractions.