#include <bits/stdc++.h>
using namespace std;
int const MAX = 2000 + 7;
long long int isPal[MAX][MAX], sum[MAX];
int main() {
  string s;
  cin >> s;
  long long int N = s.length(), ans = 0;
  for (int i = 0; i < N; ++i) isPal[i][i] = 1;
  for (int L = 2; L < N + 1; ++L)
    for (int i = 0; i < N - L + 1; ++i) {
      int j = i + L - 1;
      if (L == 2)
        isPal[i][j] = (s[i] == s[j]);
      else
        isPal[i][j] = (s[i] == s[j]) && (isPal[i + 1][j - 1]);
    }
  for (int i = 0; i < N; ++i)
    for (int j = 0; j < N; ++j) sum[i] += isPal[i][j];
  for (int i = N - 1 - 1; i >= 0; --i) sum[i] += sum[i + 1];
  for (int i = 0; i < N; ++i)
    for (int j = i; j < N; ++j)
      if (isPal[i][j]) ans += sum[j + 1];
  cout << ans << endl;
}
