#include <bits/stdc++.h>
using namespace std;
int const N = 2050;
int const INF = 1e9 + 7;
bool ok(string s) {
  string rev = s;
  reverse(rev.begin(), rev.end());
  return rev == s;
}
int n, p[N][N], sum[N];
long long dp[N];
string s;
int main() {
  cin >> s;
  n = s.size();
  int x = 0;
  for (int c = 1; c <= n; c++) {
    string cur = "";
    for (int i = c; i <= n; i++) {
      cur += s[i - 1];
      p[c][i] = ok(cur);
      x += p[c][i];
      sum[i] += p[c][i];
    }
  }
  for (int c = 1; c <= n; c++) sum[c] += sum[c - 1];
  for (int c = 1; c <= n; c++) {
    long long temp = 0;
    for (int i = 1; i <= c; i++) {
      temp += p[i][c] * 1LL * sum[i - 1];
    }
    dp[c] = temp + dp[c - 1];
  }
  cout << dp[n] << endl;
  return 0;
}
