#include <bits/stdc++.h>
using namespace std;
double pi = 3.1415926536;
const int oo = (int)1e9;
const long long OO = numeric_limits<long long>::max();
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int di[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dj[] = {1, -1, 0, 0, 1, -1, -1, 1};
int f1[] = {0, 0, 0, 1, 1, 1, -1, -1, -1};
int f2[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
int dp[2005][2005];
long long start[2001], finish[2001];
string s;
int rec(int i, int j) {
  if (dp[i][j]) return max(0, dp[i][j]);
  if (i == j || (i + 1 == j && s[i] == s[j])) {
    return dp[i][j] = 1;
  }
  if (s[i] == s[j]) return dp[i][j] = rec(i + 1, j - 1);
  dp[i][j] = -1;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  ::s = s;
  for (int i = 0; i < ((int)(s).size()); i++) {
    for (int j = i; j < ((int)(s).size()); j++) {
      if (rec(i, j)) start[i]++, finish[j]++;
    }
  }
  long long res = 0;
  for (int i = 0; i < ((int)(s).size()); i++) {
    for (int j = 0; j < i; j++) {
      res += start[i] * finish[j];
    }
  }
  cout << res;
}
