However each time he was only in office for less than two years . Derby was Prime Minister for a total of just over four years , less than many other Prime Ministers . However his ministries all lasted less than two years , and he held the post for a total of just over four years , less than many other Prime Ministers .