The number of departments, initially 83, had been increased to 130 by 1809 with the territorial gains of the Republic and of the First French Empire. Following Napoleon's defeats in 1814–1815, the Congress of Vienna returned France to its pre-war size and the number of departments was reduced to 86 (three of the original departments having been split). In 1860, France acquired the County of Nice and Savoy, which led to the creation of three new departments. Two were added from the new Savoyard territory, while the department of Alpes-Maritimes was created from Nice and a portion of the Var department. The 89 departments were given numbers based on the alphabetical order of their names.