In this case, you have 3 courses with a grade of 3, and 1 course with a grade of 1. Let's assume that each course is worth 3 credits.
So, your GPA calculation would be:
GPA = [(3 * 3) + (1 * 1)] / (3 + 1)
GPA = [9 + 1] / 4
GPA = 10 / 4
GPA = 2.5
Therefore, your GPA when you have 3 and 1 f is 2.5.