Ken had some marbles. He gave 143 marbles to a friend and lost 1/4 of the remaining marbles. He was left with 1/5 of the total number of marbles he had at first. How many marbles had he left?

Let X be the total number of marbles Ken had at first.

After giving 143 marbles, he was left with X - 143 marbles.
Then he lost 1/4 * (X - 143) marbles.
So he was left with 3/4 * (X - 143) marbles.
And this was equal to 1/5 * X.
Therefore, 3/4 * (X - 143) = 1/5 * X.
Multiplying both sides by 20, we get:
15(X - 143) = 4X
Expanding the left side:
15X - 2145 = 4X
Subtracting 4X from both sides:
11X - 2145 = 0
Adding 2145 to both sides:
11X = 2145
Dividing both sides by 11:
X = 195
Therefore, Ken had 195 marbles at first.
After giving 143 marbles, he was left with 195 - 143 = 52 marbles.
Then he lost 1/4 * 52 = 13 marbles.
So he was left with 52 - 13 = 39 marbles. Answer: \boxed{39}.

Let's break this down step by step.

Step 1: Find the total number of marbles Ken had at first.
Let's assume the total number of marbles Ken had at first is represented by "x".

Step 2: Calculate the number of marbles Ken had left after giving 143 marbles to a friend.
After giving 143 marbles to a friend, Ken would have (x - 143) marbles.

Step 3: Calculate the number of marbles Ken lost.
Ken lost 1/4 of the remaining marbles, which is 1/4 * (x - 143).

Step 4: Calculate the number of marbles Ken had left after losing some.
After losing 1/4 of the remaining marbles, Ken would have (x - 143) - (1/4 * (x - 143)) marbles left.

Step 5: Calculate the number of marbles Ken had left in terms of the initial total.
According to the given information, Ken was left with 1/5 of the total number of marbles he had at first. So, we can write the equation: (x - 143) - (1/4 * (x - 143)) = 1/5 * x.

Step 6: Solve the equation to find the value of x.
Simplifying the equation, we get (4/5) * (x - 143) = 1/5 * x.
Expanding, we have (4x/5) - (572/5) = x/5.
Multiplying through by 5 to eliminate the fractions, we have 4x - 572 = x.
Simplifying further, we get 3x = 572.
Dividing both sides by 3, we find x = 572/3.

So, the total number of marbles Ken had at first is 572/3.

Step 7: Calculate the number of marbles Ken had left.
Substituting the value of x back into the equation from step 2, we have (572/3 - 143) - (1/4 * (572/3 - 143)).
Simplifying, we get (429/3) - (1/4 * (429/3)).
Multiplying through by 4, we have (1716/12) - (429/12).
Simplifying further, we get 1287/12.

Therefore, Ken was left with 1287/12 marbles.