Amit starts from a point A and walks to another point B, and then returns from B to A by his car and thus takes a total time of 6 hours and 45 minutes. If he had driven both ways in his car, he would have taken 2 hours less. How long would it take for him to walk both ways?