stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<math.h>

#include<algorithm>

using namespace std;

int n,m;  int map[13][100003];  int book[13]; int ans; int newmap[13][100003]; int max0,max1; int preans;

void answer();

void dfs(int x)

{

	if(x==n+1) answer();

	else 

	{

		for(int i=0;i<2;i++)

		{

			book[x]=i;

			dfs(x+1);

		}

	}

}



void answer()

{

	 preans=0;

    

	for(int i=1;i<=n;i++)

	{

		if(book[i])

		for(int j=1;j<=m;j++)

		{

			newmap[i][j]=(map[i][j]+1)%2;

		}

		else 

		for(int j=1;j<=m;j++)

		{

			newmap[i][j]=map[i][j];

		}

	}



	for(int i=1;i<=m;i++)

	{

		for(int j=1;j<=n;j++)

		{

			if(newmap[j][i]==0)  max0++;

			else max1++;

		}

		 preans+=max(max0,max1);

		 max1=0; max0=0;

	}

	ans=max(ans,preans);

}





int main()

{

   	while(~scanf("%d%d",&n,&m)&&n!=0)

   	{

   		   ans=0; preans=0;

			 for(int i=1;i<=n;i++)

   		  {

   		     for(int j=1;j<=m;j++)

			 scanf("%d",&map[i][j]);	

		  }

       for(int i=0;i<2;i++)

       {

       	  book[1]=i;

       	  dfs(2);

	   }

	   cout<<ans<<endl;

	}

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.134883946822384x):
/*

 * 题目: Aizu - 0525 

 * 题意: 

 * 类型: 

 * 算法：暴力搜索

 * Date: 2020-07-07 09:37:58

 * LastEditors: loeije

 * LastEditTime: 2020-07-08 07:01:33

*/



#include <cstdio>

#include <cmath>

#include <algorithm>

using namespace std;



const int maxn = 1024 + 10;

const int row = 10 + 5, col = 10000 + 5;

int grid[row][col];

int r, c, ans = 0;



void process(int idx) {

    if(idx == r) {

        int sum = 0;

        for(int i = 0; i < c; ++i) {

            int tempsum = 0;

            for(int j = 0; j < r; ++j) {

                if(grid[j][i] == 1) {

                    tempsum++;

                }

            }



            sum += max(tempsum, r - tempsum);

        }

        ans = max(ans, sum);

        return ;

    }



    process(idx + 1);

    for(int i = 0; i < c; ++i) grid[idx][i] = !grid[idx][i];

    process(idx + 1);

}



int main() {

    while(scanf("%d%d", &r, &c) && (r + c != 0)) {

        for(int i = 0; i < r; ++i) {

            for(int j = 0; j < c; ++j) {

               scanf("%d", &grid[i][j]); 

            }

        }



        // process

        ans = 0;

        process(0);

        

        printf("%d\n", ans);

    }

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cmath>

#include <iomanip>

#include <vector>

#include <map>

#include <cstring>

#include <algorithm>

using namespace std;



struct Coordinate{

    int row;

    int col;

};

Coordinate mov_dir[4] = {{1, 0}, {0, -1}, {-1, 0}, {0, 1}};

bool mat[11][10001], one[11];

int R, C, ans;



void dfs(int row, bool flag)

{

    if (row == 10) {

        return;

    }

    if (flag) {

        for (int j = 0; j < C; j++) {

            mat[row][j] = !mat[row][j];

        }

    }

    for (int i = 0; i < C; i++) {

        int cnt_o = 0, cnt_z = 0;

        for (int j = 0; j < R; j++) {

            if (mat[j][i] == 1) {

                cnt_o++;

            }

            else {

                cnt_z++;

            }

        } 

        if (cnt_z > cnt_o) {

            for (int j = 0; j < R; j++) {

                mat[j][i] = !mat[j][i];

            }

        }

    }

        int cnt = 0;

        for (int i = 0; i < R; i++) {

            for (int j = 0; j < C; j++) {

                if (mat[i][j]) {

                    cnt++;

                }

            }

        }

    if (ans < cnt) {

        ans = cnt;

    }    

    dfs(row + 1, true);

    dfs(row + 1, false);



}

int main()

{

    ios::sync_with_stdio(false);

    cin.tie(0);

    

    while (cin >> R >> C && !(R == 0 && C == 0)) {

        ans = -1;

        for (int i = 0; i < R; i++) {

            int cnt_o = 0, cnt_z = 0;

            for (int j = 0; j < C; j++) {

                cin >> mat[i][j];

            }    

        }

        dfs(0, true);

        dfs(0, false);



        cout << ans << endl;

    }

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 6.502551112171631x):
/*

 * 题目: Aizu - 0525 

 * 题意: 

 * 类型: 

 * 算法：暴力搜索

 * Date: 2020-07-07 09:37:58

 * LastEditors: loeije

 * LastEditTime: 2020-07-08 07:01:33

*/



#include <cstdio>

#include <cmath>

#include <algorithm>

using namespace std;



const int maxn = 1024 + 10;

const int row = 10 + 5, col = 10000 + 5;

int grid[row][col];

int r, c, ans = 0;



void process(int idx) {

    if(idx == r) {

        int sum = 0;

        for(int i = 0; i < c; ++i) {

            int tempsum = 0;

            for(int j = 0; j < r; ++j) {

                if(grid[j][i] == 1) {

                    tempsum++;

                }

            }



            sum += max(tempsum, r - tempsum);

        }

        ans = max(ans, sum);

        return ;

    }



    process(idx + 1);

    for(int i = 0; i < c; ++i) grid[idx][i] = !grid[idx][i];

    process(idx + 1);

}



int main() {

    while(scanf("%d%d", &r, &c) && (r + c != 0)) {

        for(int i = 0; i < r; ++i) {

            for(int j = 0; j < c; ++j) {

               scanf("%d", &grid[i][j]); 

            }

        }



        // process

        ans = 0;

        process(0);

        

        printf("%d\n", ans);

    }

    return 0;

}
// Slower C++ solution:
#include<iostream>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m){for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}N=N>n?N:n;}main(){for(;std::cin>>R>>C,R|C;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)std::cin>>s[i][j];}

// Faster C++ solution for the same problem (measured speedup: 5.122564514282234x):
#include<cstdio>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;scanf("%d%d",&R,&C),R;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);}
// Slower C++ solution:
#include<iostream>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;std::cin>>R>>C,R|C;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);scanf("%d",s[i]+j);}

// Faster C++ solution for the same problem (measured speedup: 5.127887192859697x):
#include<cstdio>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;scanf("%d%d",&R,&C),R;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);}
// Slower C++ solution:
#include<iostream>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;std::cin>>R>>C,R|C;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);scanf("%d",s[i]+j);}

// Faster C++ solution for the same problem (measured speedup: 5.127913406900242x):
#include<cstdio>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;scanf("%d%d",&R,&C),R;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);}
// Slower C++ solution:
#include<iostream>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;std::cin>>R>>C,R|C;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);}

// Faster C++ solution for the same problem (measured speedup: 5.1271958708224x):
#include<cstdio>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;scanf("%d%d",&R,&C),R;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);}
// Slower C++ solution:
#include<iostream>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;std::cin>>R>>C,R;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)std::cin>>s[i][j];}

// Faster C++ solution for the same problem (measured speedup: 5.122583637410853x):
#include<cstdio>

int R,C,s[10000][10],f[10],N,i,j,n,m;void rec(int k){if(k<R){f[k]=0;rec(k+1);f[k]=1;rec(k+1);}else for(n=i=0;i<C;i++,n+=m>R-m?m:R-m,N=N>n?N:n)for(m=j=0;j<R;j++)m+=s[i][j]^f[j];}main(){for(;scanf("%d%d",&R,&C),R;rec(0),printf("%d\n",N))for(j=R;j-->0;)for(i=C;i-->0;)scanf("%d",s[i]+j);}
// Slower C++ solution:
#include<iostream>

#include<math.h>

using namespace std;



int r,c;

bool state[10][10000];

bool linemap[10][10000];

int mapcount;

int getnum(bool status[10][10000]){

	int num=0;

	for(int i=0;i<r;i++){

		for(int j=0;j<c;j++){

			if(status[i][j])num++;

		}

	}

	return num;

}



void adjust(){

	

		for(int j=0;j<c;j++){

			int num0=0,num1=0;

			for(int k=0;k<r;k++){

				if(linemap[k][j])num1++;

				else num0++;

			}

			if(num0>num1){

				for(int k=0;k<r;k++){

					linemap[k][j]=1-linemap[k][j];

				}

			}

		}

	

}

int creatlinemap(){

	int max=0;

	for(int i=0;i<mapcount;i++){

		for(int j=0;j<r;j++){

			if(i&(1<<j)){

				for(int k=0;k<c;k++){

					linemap[j][k]=state[j][k];

				}

				

			}

			else{

				for(int k=0;k<c;k++){

					linemap[j][k]=1-state[j][k];

				}

			}

		}

		adjust();

		int tmp=getnum(linemap);

		if(tmp>max)	max=tmp;			

	}

	return max;	

}





int main(){



	while(cin>>r>>c){

		if(r*c==0)return 0;

		mapcount=(int)pow(2.0,r);

		for(int i=0;i<r;i++){

			for(int j=0;j<c;j++){

				cin>>state[i][j];

			}

		}

		

		cout<<creatlinemap()<<endl;

	}

}

// Faster C++ solution for the same problem (measured speedup: 5.152329301980411x):
#include<stdio.h>



#define maxRow 10

#define maxCol 10000

int rows,cols;

int a[maxRow][maxCol];

int r[maxRow];

int max_num=0;



void dfs(int step){

	if(step == rows){

		int num,total=0;

		for(int j = 0; j < cols; j++)

		{

			num = 0;

			for(int i = 0; i < rows; i++){

				if(r[i] == -1 && a[i][j] == 0)num++;

				else if(r[i] == 1 && a[i][j] == 1)num++;

			}

			if(num > rows/2)total += num;

			else total += (rows - num);

		}

		if(total > max_num)max_num = total;



	}

	else{

		r[step] = -1;dfs(step+1);

		r[step] = 1;dfs(step+1);

	}

}



int main(){

	while(scanf("%d%d",&rows,&cols),rows||cols){

		max_num = 0;

		for(int i = 0; i < rows; i++)

			for(int j = 0; j < cols; j++)

				scanf("%d",&a[i][j]);

		dfs(0);

		printf("%d\n",max_num);

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>



using namespace std;

int r, c;

int Osenbei[10][10000];

int sum = 0;



void dfs(int roral) {

	if (roral == r) {

		int result = 0;

		for (int j = 0; j < c; ++j) {

			int num = 0;

			for (int i = 0; i < r; ++i) {

				if (Osenbei[i][j])

					++num;

			}

			result += max(num, r - num);

		}

		sum = max(result, sum);

		return;

	}

	dfs(roral + 1);



	

	for (int j = 0; j < c; ++j) {

		Osenbei[roral][j] = 1 - Osenbei[roral][j];

	}



	dfs(roral + 1);



	for (int j = 0; j < c; ++j) {

		Osenbei[roral][j] = 1 - Osenbei[roral][j];

	}





	return;

}



int  main() {

	while (true) {

		cin >> r >> c;

		if (c == 0) {

			break;

		}

		for (int i = 0; i < r; ++i) {

			for (int j = 0; j < c; ++j)

			{

				cin >> Osenbei[i][j];

			}

		}

		dfs(0);

		cout << sum << endl;

	}

}

// Faster C++ solution for the same problem (measured speedup: 5.131396408340492x):
#include<stdio.h>



#define maxRow 10

#define maxCol 10000

int rows,cols;

int a[maxRow][maxCol];

int r[maxRow];

int max_num=0;



void dfs(int step){

	if(step == rows){

		int num,total=0;

		for(int j = 0; j < cols; j++)

		{

			num = 0;

			for(int i = 0; i < rows; i++){

				if(r[i] == -1 && a[i][j] == 0)num++;

				else if(r[i] == 1 && a[i][j] == 1)num++;

			}

			if(num > rows/2)total += num;

			else total += (rows - num);

		}

		if(total > max_num)max_num = total;



	}

	else{

		r[step] = -1;dfs(step+1);

		r[step] = 1;dfs(step+1);

	}

}



int main(){

	while(scanf("%d%d",&rows,&cols),rows||cols){

		max_num = 0;

		for(int i = 0; i < rows; i++)

			for(int j = 0; j < cols; j++)

				scanf("%d",&a[i][j]);

		dfs(0);

		printf("%d\n",max_num);

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define IO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

const int inf = 0x3f3f3f3f;

typedef long long ll;

#define ull unsigned long long

const int maxn = 1e5+10;

const ll mod=1e9+7;

#define MAXN 40100

ll gcd(ll T, ll b) { return b == 0 ? T : gcd(b, T % b); }

ll lcm(ll T, ll b) { return T / gcd(T, b) * b; }

ll mul(ll a,ll b, ll c) {

    ll ans = 0;

    while(b) {

        if(b&1) {

            ans= (ans+a)%c;

            b--;

        }

        b>>=1;

        a=(a+a)%c;

    }

    return ans;

}

 

ll powmod(ll a,ll b,ll c) {

    ll ans = 1;

    while(b) {

        if(b&1) {

            ans = mul(ans,a,c);

            b--;

        }

        b>>=1;

        a=mul(a,a,c);

    }

    return ans ;

}

 

ll exgcd(ll a,ll b,ll &x,ll &y) {

    if(b==0)

    {

        x=1;y=0;

        return a; 

    }

    ll r=exgcd(b,a%b,x,y);

    ll temp=y;

    y=x-(a/b)*y;

    x=temp;

    return r;

}



int main() {

    ull a,ans;

    char s[6];

    cin>>a>>s;

    ans=(s[0]-'0')*100 + (s[2]-'0')*10 + (s[3]-'0'); 

    cout<<a*ans/100<<endl;

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 5.092465492001906x):
#include <stdio.h>

#include <string.h>

int main()

{

	int i,j,k,t,n,m,l,x,y,z;

	double b;

	long long a,c,d;

    while(scanf("%lld%lf",&a,&b)!=EOF){

    	d=b*100+0.1;

    	c=a*d/100;

    	printf("%lld\n",c);

	}

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

char s[10];

int main(){

	long long x;

	cin>>x;

	cin>>s;

	long long y;

	y=(s[0]-'0')*100+(s[2]-'0')*10+(s[3]-'0');

	long long z=x*y/100;

	printf("%lld\n",z); 

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.076681264885411x):
#include <stdio.h>

#include <string.h>

int main()

{

	int i,j,k,t,n,m,l,x,y,z;

	double b;

	long long a,c,d;

    while(scanf("%lld%lf",&a,&b)!=EOF){

    	d=b*100+0.1;

    	c=a*d/100;

    	printf("%lld\n",c);

	}

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    unsigned long long num;

    double frac;

    while(cin>>num>>frac)

    {

        long long con=(frac*100)+0.5;

       // unsigned long long sol=(frac*num);

       unsigned long long sol=(num*con)/100;

        cout<<sol<<endl;

        

    }

}

// Faster C++ solution for the same problem (measured speedup: 5.158292472438801x):
#include <stdio.h>

#include <string.h>

int main()

{

	int i,j,k,t,n,m,l,x,y,z;

	double b;

	long long a,c,d;

    while(scanf("%lld%lf",&a,&b)!=EOF){

    	d=b*100+0.1;

    	c=a*d/100;

    	printf("%lld\n",c);

	}

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

using namespace std;

const int N = 1e3 + 10;



signed main() {

	// ios::sync_with_stdio(false);

	ll a, b, c;

	scanf("%lld %lld.%lld", &a, &b, &c);

	b = b * 100 + c;

	ll x = a * b;

	string ans;

	while (x) ans += x % 10 + '0', x /= 10;

	if (ans.size() <= 2) printf("0\n");

	else {

		for (int i = ans.size() - 1; i > 1; i--)

			printf("%c", ans[i]);

		printf("\n");

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.082352536886709x):
#include <stdio.h>

#include <string.h>

int main()

{

	int i,j,k,t,n,m,l,x,y,z;

	double b;

	long long a,c,d;

    while(scanf("%lld%lf",&a,&b)!=EOF){

    	d=b*100+0.1;

    	c=a*d/100;

    	printf("%lld\n",c);

	}

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

using namespace std;

int main(){

	long long a;

	double b;

	cin>>a>>b;

	b=b*(100+0.1);

	a*=(int)b;

	cout<<a/100<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.155073031951883x):
#include <stdio.h>

#include <string.h>

int main()

{

	int i,j,k,t,n,m,l,x,y,z;

	double b;

	long long a,c,d;

    while(scanf("%lld%lf",&a,&b)!=EOF){

    	d=b*100+0.1;

    	c=a*d/100;

    	printf("%lld\n",c);

	}

    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

long long int a, s;

int b, c;

cin>>a;

scanf("%d.%d", &b, &c);

b=b*100+c;

s=b*a/100;

cout<<s<<endl;

return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.102601210948265x):
#include <stdio.h>

#include <string.h>

int main()

{

	int i,j,k,t,n,m,l,x,y,z;

	double b;

	long long a,c,d;

    while(scanf("%lld%lf",&a,&b)!=EOF){

    	d=b*100+0.1;

    	c=a*d/100;

    	printf("%lld\n",c);

	}

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<string>

using namespace std;

int main()

{

	string s;

	long long  n,p;

	while (cin>>n>>s)

	{

		int l = s.length();

		int b, m;

		b = m = -1;

		for (int i = 0; i < l; i++)

		{

			if (s[i] != '0')

			{

				b = i;

				break;

			}

		}

		for (int i = b; i < l; i++)

		{

			if (s[i] == '.')

			{

				m = i;

				break;

			}

		}

		p = 0;

		if (m != -1)

		{

			for (int i = l-1; i > m; i--)

			{

				p = (s[i] - '0') * n + p;

				p = p / 10;

			}

		}

		if (b != -1)

		{

			if (b == m)

				cout << p << endl;

			else

			{

				for (int i = m-1; i >= b; i--)

				{

					p = (s[i] - '0') * n + p;

					s[i] = p % 10;

					p /= 10;

				}

				

				if (p)

				{

					cout << p;

				}

				for (int i = b; i < m; i++)

				{

					cout << (int)s[i];

				}

				cout << endl;

			}

		}

	}

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.14951007967122x):
#include <stdio.h>

#include <string.h>

int main()

{

	int i,j,k,t,n,m,l,x,y,z;

	double b;

	long long a,c,d;

    while(scanf("%lld%lf",&a,&b)!=EOF){

    	d=b*100+0.1;

    	c=a*d/100;

    	printf("%lld\n",c);

	}

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<iostream>

#include<cstring>

 

using namespace std;

//初始化 

void initial(string &a, string &b){

	while (a.size()<b.size())a = '0' + a;

	while (b.size()<a.size())b = '0' + b;

}

//找出最大的字符串 

void findMax(string &a, string &b){

	string tmp;

	if (a<b){

		tmp = b;

		b = a;

		a = tmp;

	}

}

//删除第一个字符'0' 

bool del(string &a){

	if (a[0] == '0'){

		a.erase(0, 1);

		return true;

	}

	else

		return false;

}

//删除前面所有的 0 

void delAllZroe(string &a){

	while (del(a)){

		del(a);

	};

}

//大数加法 

string bigItergeAdd(string a, string b){

	initial(a, b);

	a = '0' + a;

	b = '0' + b;

	for (int i = a.size() - 1; i >= 0; i--){

		int num1 = a[i] - '0';

		int num2 = b[i] - '0';

		if (num1 + num2>9){

			a[i - 1] = a[i - 1] - '0' + 1 + '0';

			a[i] = (num1 + num2) - 10 + '0';

		}

		else{

			a[i] = (num1 + num2) + '0';

		}

	}

	del(a);

	//	cout<<a<<endl;

	return a;

}

//大数乘法(大数加法实现) 

void bigItergeMul(string a, string b){

	delAllZroe(a);

	delAllZroe(b);

	if (a == "" || b == ""){ printf("0\n"); return; }

	initial(a, b);

	findMax(a, b);

	string res = "0";

	int count = 0;

	delAllZroe(b);

	for (int i = b.size() - 1; i >= 0; i--){

		int num1 = b[i] - '0';

		if (i != b.size() - 1)		a = a + '0';

		for (int i = 1; i <= num1; i++){

			res = bigItergeAdd(res, a);

		}

	}

	delAllZroe(res);

	if (res.size()<3){ printf("0\n"); return; }

	res=res.erase(res.size()-2,2);

	cout << res << endl;

}

 

int main(){

	string a, b, t=".";

	cin>>a>>b;

	int p=b.find(t);

	b=b.erase(p,1);

	bigItergeMul(a,b);	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.24201171472717x):
#include <stdio.h>

#include <string.h>

int main()

{

	int i,j,k,t,n,m,l,x,y,z;

	double b;

	long long a,c,d;

    while(scanf("%lld%lf",&a,&b)!=EOF){

    	d=b*100+0.1;

    	c=a*d/100;

    	printf("%lld\n",c);

	}

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define IO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

const int inf = 0x3f3f3f3f;

typedef long long ll;

#define ull unsigned long long

const int maxn = 1e5+10;

const ll mod=1e9+7;

#define MAXN 40100

ll gcd(ll T, ll b) { return b == 0 ? T : gcd(b, T % b); }

ll lcm(ll T, ll b) { return T / gcd(T, b) * b; }

ll mul(ll a,ll b, ll c) {

    ll ans = 0;

    while(b) {

        if(b&1) {

            ans= (ans+a)%c;

            b--;

        }

        b>>=1;

        a=(a+a)%c;

    }

    return ans;

}

 

ll powmod(ll a,ll b,ll c) {

    ll ans = 1;

    while(b) {

        if(b&1) {

            ans = mul(ans,a,c);

            b--;

        }

        b>>=1;

        a=mul(a,a,c);

    }

    return ans ;

}

 

ll exgcd(ll a,ll b,ll &x,ll &y) {

    if(b==0)

    {

        x=1;y=0;

        return a; 

    }

    ll r=exgcd(b,a%b,x,y);

    ll temp=y;

    y=x-(a/b)*y;

    x=temp;

    return r;

}



int main() {

    ull a,ans;

    char s[6];

    cin>>a>>s;

    ans=(s[0]-'0')*100 + (s[2]-'0')*10 + (s[3]-'0'); 

    cout<<a*ans/100<<endl;

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 5.102330583826514x):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

char s[10];

int main(){

	long long x;

	cin>>x;

	cin>>s;

	long long y;

	y=(s[0]-'0')*100+(s[2]-'0')*10+(s[3]-'0');

	long long z=x*y/100;

	printf("%lld\n",z); 

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.086515779605445x):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    unsigned long long num;

    double frac;

    while(cin>>num>>frac)

    {

        long long con=(frac*100)+0.5;

       // unsigned long long sol=(frac*num);

       unsigned long long sol=(num*con)/100;

        cout<<sol<<endl;

        

    }

}

// Faster C++ solution for the same problem (measured speedup: 5.168285083872047x):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

using namespace std;

const int N = 1e3 + 10;



signed main() {

	// ios::sync_with_stdio(false);

	ll a, b, c;

	scanf("%lld %lld.%lld", &a, &b, &c);

	b = b * 100 + c;

	ll x = a * b;

	string ans;

	while (x) ans += x % 10 + '0', x /= 10;

	if (ans.size() <= 2) printf("0\n");

	else {

		for (int i = ans.size() - 1; i > 1; i--)

			printf("%c", ans[i]);

		printf("\n");

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.092198037958863x):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

using namespace std;

int main(){

	long long a;

	double b;

	cin>>a>>b;

	b=b*(100+0.1);

	a*=(int)b;

	cout<<a/100<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.1650594067054545x):
#include<cstdio>

#define LL long long

#define eps 1e-6

int main(){

	LL a,b,c;

	double d;

	scanf("%lld%lf",&a,&d);

	d+=eps;

	b=d*100;

	c=a*b/100;

	printf("%lld\n",c);

}