Chisha, hello
The way that you have asked this question , it is impossible to answer. Think about it. When sailing from the the second island to the third, you did not say how far they went. Suppose they only had to go 1km from the second island to the third island. For that you would get a specific distance for the first to third island. But supposed they went 10km to get from the second island to the third island. Then that would be a completely different distance from the first island to the third. See what I mean? Without knowing how far it is from the second island to the third, it is not possible to tell how far it is from the first island to the third.