#include <bits/stdc++.h>
using namespace std;
void RunProgram();
int main() { RunProgram(); }
const int MAXN = 2005;
char s[MAXN];
bool p[MAXN][MAXN];
int n, cL[MAXN], cR[MAXN];
long long res;
void RunProgram() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  memset(p, false, sizeof p);
  for (int i = 1; i <= n; i++) p[i][i] = true;
  for (int i = 1; i < n; i++) p[i][i + 1] = (s[i] == s[i + 1]);
  for (int k = 2; k < n; k++)
    for (int i = 1; i <= n - k; i++) {
      int j = i + k;
      p[i][j] = (s[i] == s[j] && p[i + 1][j - 1]);
    }
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++)
      if (p[i][j]) ++cL[j], ++cR[i];
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) res += cL[i] * cR[j];
  cout << res;
}
