Answer : 44
Before heading to the answer of this question, Let's talk about some general concepts/observations regarding Equivalence Relations.
1. Let $A$ be a Set of $n$ elements. Then $A \times A$ is the biggest relation possible on set $A$ (in terms if cardinality) and
$|A \times A| = n^2$ and $A\times A$ is an Equivalence relation on set $A$ with Only one Equivalence class $S$ which is same as the set $A.$
2. Let $A$ be a Set of $n$ elements. Then Identity relation $I$ ( $(a,a) \in I, \forall a\in A $) is the smalles Equivalence relation possible on set $A$ (in terms if cardinality) and It has $n$ Equivalence classes, each consisting one element of $A.$
3. Let $R$ be an Equivalence relation on set $A$ with $m$ equivalence classes $S_i, 1\leq i \leq m$ then Cardinality of $R$ is :
$|R| = |S_1|^2 + |S_2|^2....+|S_m|^2$
Which is easy to prove because we can see that an Equivalence class with $t$ elements contributes $t^2$ ordered pairs in the Equivalence relation $R.$
In the Question, Since it is given that the Equivalence relation $R$ has Three equivalence classes $S_1,S_2,S_3$, Hence,
$|R| = |S_1|^2 + |S_2|^2 + |S_3|^2$
We need to make the above value minimum and maximum.
For getting minimum cardinality of $R$, Divide elements of set $S$ uniformly among the three equivalence classes i.e. $|S_1|, |S_2| = 2, |S_3| = 3$, hence, $Y = 17$
For getting maximum cardinality of $R$, Divide elements of set $S$ among the three equivalence classes such that One of them has biggest number possible i.e. $|S_1|, |S_2| = 1, |S_3| = 5$, hence, $X = 27$
Hence, $X+Y = 44$