#include <bits/stdc++.h>
using namespace std;
const int N = 2222;
string s;
bool is[N][N];
int n;
long long sum[N];
int main() {
  cin >> s;
  n = s.size();
  for (int i = 0; i < n; i++) is[i][i] = is[i][i + 1] = 1;
  for (int sz = 2; sz < n; sz++)
    for (int i = 0; i + sz <= n; i++) {
      is[i][i + sz] = is[i + 1][i + sz - 1] && (s[i] == s[i + sz - 1]);
    }
  for (int i = n - 1; i >= 0; i--) {
    sum[i] = sum[i + 1];
    for (int j = i + 1; j <= n + 2; j++) sum[i] += is[i][j];
  }
  long long res = 0;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j <= n; j++)
      if (is[i][j]) res += sum[j];
  cout << res << endl;
}
