Or you can fill the 3 gallon bucket and pour it into the empty 5 gallon bucket. Then fill the 3 gallon bucket again and fill the 5 gallon bucket up from it. That leaves one gallon in the 3 gallon bucket. Pour the 5 gallon bucket out, then pour in the one gallon left from the 3 gallon bucket into the 5 gallon bucket. Then fill the 3 gallon bucket again and empty it into the 5 gallon bucket. Four gallons in the 5 gallon bucket.
Bah, Ronstang beat me to it.