#include <bits/stdc++.h>
using namespace std;
long long dp[2234], sum[2234], pal[2234][2234];
string a;
bool chk(int l, int r) {
  for (int i = l, j = r; i < j; i++, j--) {
    if (a[i] != a[j]) return false;
  }
  return true;
}
int main() {
  cin >> a;
  int n = a.size();
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) pal[i][j] = chk(i, j);
  }
  sum[0] = 1LL, dp[0] = 0LL;
  for (int i = 1; i < n; i++) {
    sum[i] = sum[i - 1];
    for (int j = 0; j <= i; j++) {
      sum[i] += pal[j][i];
    }
  }
  for (int i = 1; i < n; i++) {
    dp[i] = dp[i - 1];
    for (int j = 1; j <= i; j++) {
      dp[i] += pal[j][i] * sum[j - 1];
    }
  }
  cout << dp[n - 1];
  return 0;
}
